Commit c0abdb66 authored by Jan Möbius's avatar Jan Möbius
Browse files

Switch available drawmodes function from const to non const as nodes may...

Switch available drawmodes function from const to non const as nodes may dynamically change the supported drawmodes depending on the data they have

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@12533 383ad7c9-94d9-4d36-a494-682f7c89f535
parent d14e079a
...@@ -82,7 +82,7 @@ boundingBox(Vec3d& /*_bbMin*/, Vec3d& /*_bbMax*/) ...@@ -82,7 +82,7 @@ boundingBox(Vec3d& /*_bbMin*/, Vec3d& /*_bbMax*/)
DrawModes::DrawMode DrawModes::DrawMode
QtWidgetNode:: QtWidgetNode::
availableDrawModes() const availableDrawModes()
{ {
return ( DrawModes::SOLID_FLAT_SHADED ); return ( DrawModes::SOLID_FLAT_SHADED );
} }
......
...@@ -104,7 +104,7 @@ public: ...@@ -104,7 +104,7 @@ public:
ACG_CLASSNAME(QtWidgetNode); ACG_CLASSNAME(QtWidgetNode);
/// return available draw modes /// return available draw modes
DrawModes::DrawMode availableDrawModes() const; DrawModes::DrawMode availableDrawModes();
/// update bounding box /// update bounding box
void boundingBox(Vec3d& _bbMin, Vec3d& _bbMax); void boundingBox(Vec3d& _bbMin, Vec3d& _bbMax);
......
...@@ -151,7 +151,7 @@ public: ...@@ -151,7 +151,7 @@ public:
/** Return a list of available draw modes for this node: should be OR'ed /** Return a list of available draw modes for this node: should be OR'ed
from the items of the enum DrawModeIDs. */ from the items of the enum DrawModeIDs. */
virtual DrawModes::DrawMode availableDrawModes() const { return DrawModes::NONE; } virtual DrawModes::DrawMode availableDrawModes() { return DrawModes::NONE; }
/** Compute the bounding box of this node and update the values /** Compute the bounding box of this node and update the values
_bbMin and _bbMax accordingly. Do not initialize _bbMin and _bbMin and _bbMax accordingly. Do not initialize _bbMin and
......
...@@ -65,7 +65,7 @@ namespace SceneGraph { ...@@ -65,7 +65,7 @@ namespace SceneGraph {
DrawModes::DrawMode DrawModes::DrawMode
BoundingBoxNode:: BoundingBoxNode::
availableDrawModes() const availableDrawModes()
{ {
return DrawModes::WIREFRAME; return DrawModes::WIREFRAME;
} }
......
...@@ -96,7 +96,7 @@ public: ...@@ -96,7 +96,7 @@ public:
ACG_CLASSNAME(BoundingBoxNode); ACG_CLASSNAME(BoundingBoxNode);
/// return available draw modes /// return available draw modes
DrawModes::DrawMode availableDrawModes() const; DrawModes::DrawMode availableDrawModes();
/// draw lines and normals /// draw lines and normals
void draw(GLState& _state, const DrawModes::DrawMode& _drawMode); void draw(GLState& _state, const DrawModes::DrawMode& _drawMode);
......
...@@ -83,7 +83,7 @@ CoordFrameNode(BaseNode* _parent, const std::string& _name) ...@@ -83,7 +83,7 @@ CoordFrameNode(BaseNode* _parent, const std::string& _name)
DrawModes::DrawMode DrawModes::DrawMode
CoordFrameNode::availableDrawModes() const CoordFrameNode::availableDrawModes()
{ {
return ( DrawModes::WIREFRAME | return ( DrawModes::WIREFRAME |
DrawModes::SOLID_FLAT_SHADED ); DrawModes::SOLID_FLAT_SHADED );
......
...@@ -93,7 +93,7 @@ public: ...@@ -93,7 +93,7 @@ public:
/// implement className() /// implement className()
ACG_CLASSNAME(CoordFrameNode); ACG_CLASSNAME(CoordFrameNode);
/// return available draw modes /// return available draw modes
DrawModes::DrawMode availableDrawModes() const; DrawModes::DrawMode availableDrawModes();
/// update bounding box /// update bounding box
void boundingBox(Vec3d& _bbMin, Vec3d& _bbMax); void boundingBox(Vec3d& _bbMin, Vec3d& _bbMax);
/// drawing the primitive /// drawing the primitive
......
...@@ -79,7 +79,7 @@ boundingBox(Vec3d& /*_bbMin*/, Vec3d& /*_bbMax*/) ...@@ -79,7 +79,7 @@ boundingBox(Vec3d& /*_bbMin*/, Vec3d& /*_bbMax*/)
DrawModes::DrawMode DrawModes::DrawMode
CoordsysNode:: CoordsysNode::
availableDrawModes() const availableDrawModes()
{ {
return ( DrawModes::POINTS | return ( DrawModes::POINTS |
DrawModes::POINTS_SHADED | DrawModes::POINTS_SHADED |
......
...@@ -111,7 +111,7 @@ public: ...@@ -111,7 +111,7 @@ public:
ACG_CLASSNAME(CoordsysNode); ACG_CLASSNAME(CoordsysNode);
/// return available draw modes /// return available draw modes
ACG::SceneGraph::DrawModes::DrawMode availableDrawModes() const; ACG::SceneGraph::DrawModes::DrawMode availableDrawModes();
/// update bounding box /// update bounding box
void boundingBox(Vec3d& _bbMin, Vec3d& _bbMax); void boundingBox(Vec3d& _bbMin, Vec3d& _bbMax);
......
...@@ -101,7 +101,7 @@ namespace DrawModes { ...@@ -101,7 +101,7 @@ namespace DrawModes {
* *
* This constructor creates a DrawMode with the given drawMode index. * This constructor creates a DrawMode with the given drawMode index.
* Be CareFull! this constructor can only be used to construct atomic drawmodes! * Be CareFull! this constructor can only be used to construct atomic drawmodes!
* The int will not be handled like an bitset but really as an index. * The unsigned int will not be handled like an bitset but really as an index.
* See the list of draw modes below to check for the right numbers. * See the list of draw modes below to check for the right numbers.
* You should use the predefined drawModes or create new ones using the other functions * You should use the predefined drawModes or create new ones using the other functions
* and ignore this constructor! * and ignore this constructor!
......
...@@ -78,7 +78,7 @@ EnvMapNode::EnvMapNode( BaseNode* _parent, ...@@ -78,7 +78,7 @@ EnvMapNode::EnvMapNode( BaseNode* _parent,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
DrawModes::DrawMode EnvMapNode::availableDrawModes() const DrawModes::DrawMode EnvMapNode::availableDrawModes()
{ {
return ACG::SceneGraph::DrawModes::SOLID_ENV_MAPPED; return ACG::SceneGraph::DrawModes::SOLID_ENV_MAPPED;
} }
......
...@@ -87,7 +87,7 @@ public: ...@@ -87,7 +87,7 @@ public:
ACG_CLASSNAME(EnvMapNode); ACG_CLASSNAME(EnvMapNode);
/// add env mapping /// add env mapping
DrawModes::DrawMode availableDrawModes() const; DrawModes::DrawMode availableDrawModes();
/// set texture /// set texture
void enter(GLState& _state, const DrawModes::DrawMode& _drawmode); void enter(GLState& _state, const DrawModes::DrawMode& _drawmode);
......
...@@ -123,7 +123,7 @@ boundingBox(Vec3d& _bbMin, Vec3d& _bbMax) ...@@ -123,7 +123,7 @@ boundingBox(Vec3d& _bbMin, Vec3d& _bbMax)
DrawModes::DrawMode DrawModes::DrawMode
GlutPrimitiveNode:: GlutPrimitiveNode::
availableDrawModes() const availableDrawModes()
{ {
return ( DrawModes::POINTS | return ( DrawModes::POINTS |
DrawModes::WIREFRAME | DrawModes::WIREFRAME |
......
...@@ -204,7 +204,7 @@ public: ...@@ -204,7 +204,7 @@ public:
ACG_CLASSNAME(GlutPrimitiveNode); ACG_CLASSNAME(GlutPrimitiveNode);
/// return available draw modes /// return available draw modes
DrawModes::DrawMode availableDrawModes() const; DrawModes::DrawMode availableDrawModes();
/// update bounding box /// update bounding box
void boundingBox(Vec3d& _bbMin, Vec3d& _bbMax); void boundingBox(Vec3d& _bbMin, Vec3d& _bbMax);
......
...@@ -88,7 +88,7 @@ GridNode(BaseNode* _parent, const std::string& _name) ...@@ -88,7 +88,7 @@ GridNode(BaseNode* _parent, const std::string& _name)
DrawModes::DrawMode DrawModes::DrawMode
GridNode::availableDrawModes() const GridNode::availableDrawModes()
{ {
return ( DrawModes::WIREFRAME | return ( DrawModes::WIREFRAME |
DrawModes::SOLID_FLAT_SHADED ); DrawModes::SOLID_FLAT_SHADED );
......
...@@ -99,7 +99,7 @@ public: ...@@ -99,7 +99,7 @@ public:
ACG_CLASSNAME(GridNode); ACG_CLASSNAME(GridNode);
/// return available draw modes /// return available draw modes
ACG::SceneGraph::DrawModes::DrawMode availableDrawModes() const; ACG::SceneGraph::DrawModes::DrawMode availableDrawModes();
/// update bounding box /// update bounding box
void boundingBox(Vec3d& _bbMin, Vec3d& _bbMax); void boundingBox(Vec3d& _bbMin, Vec3d& _bbMax);
......
...@@ -81,7 +81,7 @@ boundingBox(Vec3d& _bbMin, Vec3d& _bbMax) ...@@ -81,7 +81,7 @@ boundingBox(Vec3d& _bbMin, Vec3d& _bbMax)
DrawModes::DrawMode DrawModes::DrawMode
LineNode:: LineNode::
availableDrawModes() const availableDrawModes()
{ {
return DrawModes::WIREFRAME; return DrawModes::WIREFRAME;
} }
......
...@@ -123,7 +123,7 @@ public: ...@@ -123,7 +123,7 @@ public:
ACG_CLASSNAME(LineNode); ACG_CLASSNAME(LineNode);
/// return available draw modes /// return available draw modes
DrawModes::DrawMode availableDrawModes() const; DrawModes::DrawMode availableDrawModes();
/// update bounding box /// update bounding box
void boundingBox(Vec3d& _bbMin, Vec3d& _bbMax); void boundingBox(Vec3d& _bbMin, Vec3d& _bbMax);
......
...@@ -132,7 +132,7 @@ MeshNodeT<Mesh>:: ...@@ -132,7 +132,7 @@ MeshNodeT<Mesh>::
template<class Mesh> template<class Mesh>
DrawModes::DrawMode DrawModes::DrawMode
MeshNodeT<Mesh>:: MeshNodeT<Mesh>::
availableDrawModes() const { availableDrawModes() {
DrawModes::DrawMode drawModes(DrawModes::NONE); DrawModes::DrawMode drawModes(DrawModes::NONE);
// We can always render points and a wireframe. // We can always render points and a wireframe.
......
...@@ -274,7 +274,7 @@ public: ...@@ -274,7 +274,7 @@ public:
* The drawmodes are constructed based on the mesh properties and the hardware capabilities * The drawmodes are constructed based on the mesh properties and the hardware capabilities
* of the system. * of the system.
*/ */
ACG::SceneGraph::DrawModes::DrawMode availableDrawModes() const; ACG::SceneGraph::DrawModes::DrawMode availableDrawModes();
private: private:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment