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

Switch enter,draw,leave and enterpick,leavepick to get drawmode as const ref

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10926 383ad7c9-94d9-4d36-a494-682f7c89f535
parent f56daf66
......@@ -93,7 +93,7 @@ availableDrawModes() const
void
QtWidgetNode::
draw(GLState& _state , DrawModes::DrawMode /*_drawMode*/)
draw(GLState& _state , const DrawModes::DrawMode& /*_drawMode*/)
{
// Project 3d point onto screen
ACG::Vec3d projected = _state.project(position_);
......
......@@ -110,7 +110,7 @@ public:
void boundingBox(Vec3d& _bbMin, Vec3d& _bbMax);
/// draw points and normals
void draw(GLState& _state, DrawModes::DrawMode _drawMode);
void draw(GLState& _state, const DrawModes::DrawMode& _drawMode);
void position(ACG::Vec3d _position) { position_ = _position; };
......
......@@ -172,7 +172,7 @@ BaseNode::delete_subtree()
//----------------------------------------------------------------------------
void
BaseNode::enterPick(GLState& _state, PickTarget /*_target*/, DrawModes::DrawMode _drawMode)
BaseNode::enterPick(GLState& _state, PickTarget /*_target*/, const DrawModes::DrawMode& _drawMode)
{
enter (_state, _drawMode);
}
......@@ -180,7 +180,7 @@ BaseNode::enterPick(GLState& _state, PickTarget /*_target*/, DrawModes::DrawMode
//----------------------------------------------------------------------------
void
BaseNode::leavePick(GLState& _state, PickTarget /*_target*/, DrawModes::DrawMode _drawMode)
BaseNode::leavePick(GLState& _state, PickTarget /*_target*/, const DrawModes::DrawMode& _drawMode)
{
leave (_state, _drawMode);
}
......
......@@ -166,23 +166,22 @@ public:
function.
\see MaterialNode
*/
virtual void enter(GLState& /*_state */, DrawModes::DrawMode /*_drawMode*/ ) {}
virtual void enter(GLState& /*_state */, const DrawModes::DrawMode& /*_drawMode*/ ) {}
/** Draw this node using the draw modes _drawMode */
virtual void draw(GLState& /* _state */, DrawModes::DrawMode /* _drawMode */) {}
virtual void draw(GLState& /* _state */, const DrawModes::DrawMode& /* _drawMode */) {}
/** The leave function is used to restore GL states the have been changed.
This function must restore the status before enter() !
*/
virtual void leave(GLState& /* _state */, DrawModes::DrawMode /* _drawMode */) {}
virtual void leave(GLState& /* _state */, const DrawModes::DrawMode& /* _drawMode */) {}
/** This function is called when traversing the scene graph during picking
and arriving at this node. It can be used to store GL states that
will be changed in order to restore then in the leavePick()
function. Its default implementation will call the enter() function.
*/
virtual void enterPick(GLState& _state , PickTarget _target,
DrawModes::DrawMode _drawMode );
virtual void enterPick(GLState& _state , PickTarget _target, const DrawModes::DrawMode& _drawMode );
/** Draw the node using the GL picking name stack. The node's ID
will already be on the name stack, so only names identifing e.g. faces
......@@ -194,8 +193,7 @@ public:
This function must restore the status before enterPick() !
Its default implementation will call the leave() function.
*/
virtual void leavePick(GLState& _state, PickTarget _target,
DrawModes::DrawMode _drawMode );
virtual void leavePick(GLState& _state, PickTarget _target, const DrawModes::DrawMode& _drawMode );
/** Enable or Disable picking for this node
* ( default: enabled )
......
......@@ -79,7 +79,7 @@ BoundingBoxNode::~BoundingBoxNode() {
void
BoundingBoxNode::
draw(GLState& /* _state */ , DrawModes::DrawMode _drawMode)
draw(GLState& /* _state */ , const DrawModes::DrawMode& _drawMode)
{
ACG::SceneGraph::BoundingBoxAction act;
......
......@@ -99,7 +99,7 @@ public:
DrawModes::DrawMode availableDrawModes() const;
/// draw lines and normals
void draw(GLState& _state, DrawModes::DrawMode _drawMode);
void draw(GLState& _state, const DrawModes::DrawMode& _drawMode);
};
......
......@@ -67,7 +67,7 @@ CartesianClippingNode::CartesianClippingNode( BaseNode* _parent,
void
CartesianClippingNode::enter( GLState & _state, DrawModes::DrawMode /* _drawmode */ )
CartesianClippingNode::enter( GLState & _state, const DrawModes::DrawMode& /* _drawmode */ )
{
Vec3d eye = _state.eye();
......@@ -146,7 +146,7 @@ CartesianClippingNode::enter( GLState & _state, DrawModes::DrawMode /* _drawmode
void
CartesianClippingNode::leave( GLState & /* _state */ , DrawModes::DrawMode /* _drawmode */ )
CartesianClippingNode::leave( GLState & /* _state */ , const DrawModes::DrawMode& /* _drawmode */ )
{
glDisable( GL_CLIP_PLANE0 );
glDisable( GL_CLIP_PLANE1 );
......
......@@ -87,10 +87,10 @@ public:
ACG_CLASSNAME(CartesianClippingNode);
/// begin clipping
void enter( GLState & _state, DrawModes::DrawMode _drawmode );
void enter( GLState & _state, const DrawModes::DrawMode& _drawmode );
/// stop clipping
void leave( GLState & _state, DrawModes::DrawMode _drawmode );
void leave( GLState & _state, const DrawModes::DrawMode& _drawmode );
/// set position
void set_cursor( const Vec3f & _pos );
......
......@@ -133,7 +133,7 @@ ClippingNode::set_offset(float _offset)
//----------------------------------------------------------------------------
void ClippingNode::enter(GLState& /* _state */ , DrawModes::DrawMode /* _drawmode */ )
void ClippingNode::enter(GLState& /* _state */ , const DrawModes::DrawMode& /* _drawmode */ )
{
// one clipping plane
if (slice_width_ == 0.0)
......@@ -157,7 +157,7 @@ void ClippingNode::enter(GLState& /* _state */ , DrawModes::DrawMode /* _drawmod
//----------------------------------------------------------------------------
void ClippingNode::leave(GLState& /* _state */ , DrawModes::DrawMode /* _drawmode */ )
void ClippingNode::leave(GLState& /* _state */ , const DrawModes::DrawMode& /* _drawmode */ )
{
glDisable(GL_CLIP_PLANE0);
if (slice_width_ > 0.0)
......
......@@ -96,10 +96,10 @@ public:
ACG_CLASSNAME(ClippingNode);
/// set texture
void enter(GLState& _state, DrawModes::DrawMode _drawmode);
void enter(GLState& _state, const DrawModes::DrawMode& _drawmode);
/// restores original texture (or no-texture)
void leave(GLState& _state, DrawModes::DrawMode _drawmode);
void leave(GLState& _state, const DrawModes::DrawMode& _drawmode);
/// set position and normal of plane
void set_plane(const Vec3f& _position, const Vec3f& _normal, float _eps=0.0);
......
......@@ -105,7 +105,7 @@ CoordFrameNode::boundingBox(Vec3d& _bbMin, Vec3d& _bbMax)
void
CoordFrameNode::draw(GLState& /* _state */ , DrawModes::DrawMode /* _drawMode */ )
CoordFrameNode::draw(GLState& /* _state */ , const DrawModes::DrawMode& /* _drawMode */ )
{
// draw bounding box
......
......@@ -97,7 +97,7 @@ public:
/// update bounding box
void boundingBox(Vec3d& _bbMin, Vec3d& _bbMax);
/// drawing the primitive
void draw(GLState& _state, DrawModes::DrawMode _drawMode);
void draw(GLState& _state, const DrawModes::DrawMode& _drawMode);
/// update bounding box (compute in from BB of children)
......
......@@ -208,7 +208,7 @@ CoordsysNode::drawCoordsysPick( GLState& _state) {
void
CoordsysNode::
draw(GLState& _state , DrawModes::DrawMode /*_drawMode*/)
draw(GLState& _state , const DrawModes::DrawMode& /*_drawMode*/)
{
GLenum prev_depth = _state.depthFunc();
......
......@@ -117,7 +117,7 @@ public:
void boundingBox(Vec3d& _bbMin, Vec3d& _bbMax);
/// draw Coordsys
void draw(GLState& _state, DrawModes::DrawMode _drawMode);
void draw(GLState& _state, const DrawModes::DrawMode& _drawMode);
/// draw Coordsys for object picking
void pick(GLState& _state, PickTarget _target);
......
......@@ -174,7 +174,7 @@ DrawMode& DrawMode::operator++() {
return (*this);
}
DrawMode DrawMode::operator&(const DrawMode& _mode) {
DrawMode DrawMode::operator&(const DrawMode& _mode) const {
// If we are asked for Point, also return the Modes for Points shaded and colors
// if ( (_mode.modeFlags_ & POINTS.modeFlags_).any() )
......@@ -265,7 +265,7 @@ bool DrawMode::isAtomic() {
//----------------------------------------------------------------------------
bool
DrawMode::containsAtomicDrawMode( DrawMode _atomicDrawMode)
DrawMode::containsAtomicDrawMode( DrawMode _atomicDrawMode) const
{
return (*this) & _atomicDrawMode;
}
......
......@@ -117,7 +117,7 @@ namespace DrawModes {
bool operator==(const DrawMode& _mode) const;
DrawMode operator&(const DrawMode& _mode);
DrawMode operator&(const DrawMode& _mode) const;
DrawMode& operator++();
......@@ -154,7 +154,7 @@ namespace DrawModes {
/** \brief Check whether an Atomic DrawMode is active in this draw Mode
*/
bool containsAtomicDrawMode( DrawMode _atomicDrawMode );
bool containsAtomicDrawMode( DrawMode _atomicDrawMode ) const;
/** \brief Seperates this drawMode into a list of all seperate atomic drawmodes
*
......
......@@ -87,7 +87,7 @@ DrawModes::DrawMode EnvMapNode::availableDrawModes() const
//----------------------------------------------------------------------------
void EnvMapNode::enter(GLState& _state, DrawModes::DrawMode _drawmode)
void EnvMapNode::enter(GLState& _state, const DrawModes::DrawMode& _drawmode)
{
if (_drawmode==DrawModes::SOLID_ENV_MAPPED)
{
......@@ -105,7 +105,7 @@ void EnvMapNode::enter(GLState& _state, DrawModes::DrawMode _drawmode)
//----------------------------------------------------------------------------
void EnvMapNode::leave(GLState& _state, DrawModes::DrawMode _drawmode)
void EnvMapNode::leave(GLState& _state, const DrawModes::DrawMode& _drawmode)
{
if (_drawmode==DrawModes::SOLID_ENV_MAPPED)
{
......@@ -117,15 +117,11 @@ void EnvMapNode::leave(GLState& _state, DrawModes::DrawMode _drawmode)
TextureNode::leave( _state, _drawmode);
}
void EnvMapNode::enterPick(GLState& /*_state*/ ,
PickTarget /*_target*/,
DrawModes::DrawMode /*_drawMode*/ ) {
void EnvMapNode::enterPick(GLState& /*_state*/ , PickTarget /*_target*/, const DrawModes::DrawMode& /*_drawMode*/ ) {
}
void EnvMapNode::leavePick(GLState& /*_state*/,
PickTarget /*_target*/,
DrawModes::DrawMode /*_drawMode*/ ) {
void EnvMapNode::leavePick(GLState& /*_state*/, PickTarget /*_target*/, const DrawModes::DrawMode& /*_drawMode*/ ) {
}
......
......@@ -90,18 +90,18 @@ public:
DrawModes::DrawMode availableDrawModes() const;
/// set texture
void enter(GLState& _state, DrawModes::DrawMode _drawmode);
void enter(GLState& _state, const DrawModes::DrawMode& _drawmode);
/// restores original texture (or no-texture)
void leave(GLState& _state, DrawModes::DrawMode _drawmode);
void leave(GLState& _state, const DrawModes::DrawMode& _drawmode);
/** \brief Do nothing in picking
*/
void enterPick(GLState& _state, PickTarget _target, DrawModes::DrawMode _drawMode );
void enterPick(GLState& _state, PickTarget _target, const DrawModes::DrawMode& _drawMode );
/** \brief Do nothing in picking
*/
void leavePick(GLState& _state, PickTarget _target, DrawModes::DrawMode _drawMode );
void leavePick(GLState& _state, PickTarget _target, const DrawModes::DrawMode& _drawMode );
};
......
......@@ -137,7 +137,7 @@ availableDrawModes() const
void
GlutPrimitiveNode::
draw(GLState& _state, DrawModes::DrawMode _drawMode)
draw(GLState& _state, const DrawModes::DrawMode& _drawMode)
{
for (int i = 0; i < (int)primitives_.size(); ++i)
{
......
......@@ -210,7 +210,7 @@ public:
void boundingBox(Vec3d& _bbMin, Vec3d& _bbMax);
/// drawing the primitive
void draw(GLState& _state, DrawModes::DrawMode _drawMode);
void draw(GLState& _state, const DrawModes::DrawMode& _drawMode);
void draw_obj(int _idx) const;
/// picking
......
Markdown is supported
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