V-ART
Public Types | Public Member Functions | Public Attributes | Protected Attributes | List of all members
VART::GraphicObj Class Referenceabstract

An scene node that is associated with a shape. More...

#include <graphicobj.h>

Inheritance diagram for VART::GraphicObj:
VART::SceneNode VART::MemoryObj VART::Cone VART::Curve VART::Cylinder VART::Dot VART::MeshObject VART::PolyLine VART::RefSystem VART::Sphere

Public Types

enum  ShowType {
  LINES, LINES_AND_NORMALS, POINTS, POINTS_AND_NORMALS,
  FILLED
}
 
- Public Types inherited from VART::SceneNode
enum  TypeID {
  NONE, GRAPHIC_OBJ, BOX, CONE,
  CURVE, BEZIER, CYLINDER, IMAGE,
  IMAGE_2D, VOLUME, MESH_OBJECT, SPHERE,
  JOINT, BIAXIAL_JOINT, CONDYLAR_JOINT, ELLIPSOID_JOINT,
  SADDLE_JOINT, PLANE_JOINT, POLYAXIAL_JOINT, UNIAXIAL_JOINT,
  HINGE_JOINT, PIVOT_JOINT, TRANSFORM
}
 

Public Member Functions

 GraphicObj ()
 
void Show ()
 Makes the object visible. More...
 
void Hide ()
 Makes the object invisible. More...
 
void ToggleVisibility ()
 Toggles the object's visibility. More...
 
void ToggleRecVisibility ()
 Toggles the recursive object's visibility. More...
 
bool IsVisible ()
 Checks whether the object is visible. More...
 
virtual void ComputeBoundingBox ()=0
 Computes the bounding box. More...
 
void ComputeRecursiveBoundingBox ()
 Computes the recursive bounding box. More...
 
const BoundingBoxGetBoundingBox () const
 Returns the bounding box. More...
 
void SetBBoxVisibility (bool value)
 Sets the bounding box visibility. More...
 
void SetBBoxColor (VART::Color value)
 Sets the bounding box color of graphics object. More...
 
const BoundingBoxGetRecursiveBoundingBox () const
 Returns the recursive bounding box. More...
 
void ToggleBBoxVisibility ()
 Toggles the bounding box visibility. More...
 
void ToggleRecBBoxVisibility ()
 Toggles the recursive bounding box visibility. More...
 
unsigned int PickName () const
 Returns the pick name. More...
 
virtual void DrawForPicking () const
 Draws and object, setting pick info. More...
 
- Public Member Functions inherited from VART::SceneNode
 SceneNode ()
 Creates an uninitialized scene node. More...
 
 SceneNode (SceneNode &node)
 
virtual ~SceneNode ()
 
SceneNodeoperator= (const SceneNode &node)
 
virtual SceneNodeCopy ()=0
 
virtual SceneNodeRecursiveCopy ()
 
const std::string & GetDescription () const
 Returns a copy of the object's description. More...
 
void SetDescription (const std::string &desc)
 Changes the object's description. More...
 
void AddChild (SceneNode &child)
 Add a child at the end of child list. More...
 
bool DetachChild (SceneNode *childPtr)
 Removes a child from the child list. More...
 
virtual bool DrawOGL () const
 Recursive drawing using OpenGL commands. More...
 
virtual TypeID GetID () const
 Returns type identification of the node. More...
 
void AutoDeleteChildren () const
 Deletes (dealocate memory) recursively all children marked as 'autoDelete'. More...
 
SceneNodeFindChildByName (const std::string &name) const
 Recusively searches its children for a given name. More...
 
std::list< SceneNode * > GetChilds ()
 
bool FindPathTo (SceneNode *targetPtr, SGPath *resultPtr) const
 Search target among children. More...
 
bool FindPathTo (const std::string &targetName, SGPath *resultPtr) const
 Search target among children. More...
 
int GetNodeTypeList (TypeID type, std::list< SceneNode * > &nodeList)
 Find all the nodes of with typeID 'type'. More...
 
virtual void TraverseDepthFirst (SNOperator *operatorPtr) const
 Process all children in depth-first order. More...
 
virtual void TraverseBreadthFirst (SNOperator *operatorPtr) const
 Process all children in breadth-first order. More...
 
virtual void LocateDepthFirst (SNLocator *locatorPtr) const
 Seaches for a particular scene node (depth first) More...
 
virtual void LocateBreadthFirst (SNLocator *locatorPtr) const
 Seaches for a particular scene node (breadth first) More...
 
virtual void XmlPrintOn (std::ostream &os, unsigned int indent) const
 Recursively outputs XML representation of the scene node. More...
 
- Public Member Functions inherited from VART::MemoryObj
 MemoryObj ()
 Default constructor. More...
 
 MemoryObj (const VART::MemoryObj &obj)
 Copy constructor. More...
 

Public Attributes

ShowType howToShow
 Defines how to show the object. More...
 
- Public Attributes inherited from VART::MemoryObj
bool autoDelete
 

Protected Attributes

bool show
 
BoundingBox bBox
 
BoundingBox recBBox
 
unsigned int pickName
 A number that uniquely identifies the object for picking purposes. More...
 
- Protected Attributes inherited from VART::SceneNode
std::list< SceneNode * > childList
 Child list. More...
 
std::string description
 Textual identification. More...
 

Additional Inherited Members

- Static Public Attributes inherited from VART::SceneNode
static bool recursivePrinting = true
 
- Protected Member Functions inherited from VART::SceneNode
virtual bool DrawInstanceOGL () const
 Non-recursive drawing - should be overriden by every derived class. More...
 
bool RecursiveFindPathTo (SceneNode *targetPtr, SGPath *resultPtr) const
 Recursive auxiliar method for FindPathTo. More...
 
bool RecursiveFindPathTo (const std::string &targetName, SGPath *resultPtr) const
 Recursive auxiliar method for FindPathTo. More...
 

Detailed Description

An scene node that is associated with a shape.

Abstract class for graphical objects, that is, objects that have shapes to be drawn. A graphical object may, or may not, be visible without affecting scene graph traversal.

Definition at line 18 of file graphicobj.h.

Member Enumeration Documentation

Enumerator
LINES 
LINES_AND_NORMALS 
POINTS 
POINTS_AND_NORMALS 
FILLED 

Definition at line 21 of file graphicobj.h.

Constructor & Destructor Documentation

VART::GraphicObj::GraphicObj ( )

Definition at line 12 of file graphicobj.cpp.

Member Function Documentation

virtual void VART::GraphicObj::ComputeBoundingBox ( )
pure virtual

Computes the bounding box.

Implemented in VART::MeshObject, VART::PolyLine, VART::Sphere, VART::Cone, VART::Cylinder, VART::Dot, and VART::RefSystem.

void VART::GraphicObj::ComputeRecursiveBoundingBox ( )

Computes the recursive bounding box.

This method requires a correct bounding box, therefore it should usually be called after ComputeBoundingBox.

Definition at line 63 of file graphicobj.cpp.

References ComputeRecursiveBoundingBox(), GetRecursiveBoundingBox(), and VART::Transform::RecursiveBoundingBox().

Referenced by VART::Scene::ComputeBoundingBox(), ComputeRecursiveBoundingBox(), and VART::Transform::RecursiveBoundingBox().

void VART::GraphicObj::DrawForPicking ( ) const
virtual

Draws and object, setting pick info.

This method should be called in selection mode in order to identify objects that are selected by the mouse (see Scene::Pick).

Implements VART::SceneNode.

Definition at line 90 of file graphicobj.cpp.

const BoundingBox& VART::GraphicObj::GetBoundingBox ( ) const
inline

Returns the bounding box.

Definition at line 49 of file graphicobj.h.

References bBox.

const BoundingBox& VART::GraphicObj::GetRecursiveBoundingBox ( ) const
inline

Returns the recursive bounding box.

Definition at line 58 of file graphicobj.h.

References recBBox.

Referenced by VART::Scene::ComputeBoundingBox(), ComputeRecursiveBoundingBox(), and VART::Transform::RecursiveBoundingBox().

void VART::GraphicObj::Hide ( )

Makes the object invisible.

Definition at line 23 of file graphicobj.cpp.

bool VART::GraphicObj::IsVisible ( )

Checks whether the object is visible.

Definition at line 59 of file graphicobj.cpp.

unsigned int VART::GraphicObj::PickName ( ) const
inline

Returns the pick name.

The pick name is used when picking objects with the mouse. Selection methods return the pick name which can be searched for in the scene graph.

Definition at line 70 of file graphicobj.h.

References pickName.

Referenced by VART::PickNameLocator::OperateOn().

void VART::GraphicObj::SetBBoxColor ( VART::Color  value)
inline

Sets the bounding box color of graphics object.

Definition at line 55 of file graphicobj.h.

References bBox, and VART::BoundingBox::SetColor().

void VART::GraphicObj::SetBBoxVisibility ( bool  value)
inline

Sets the bounding box visibility.

Definition at line 52 of file graphicobj.h.

References bBox, and VART::BoundingBox::visible.

void VART::GraphicObj::Show ( )

Makes the object visible.

Definition at line 19 of file graphicobj.cpp.

void VART::GraphicObj::ToggleBBoxVisibility ( )

Toggles the bounding box visibility.

Definition at line 51 of file graphicobj.cpp.

void VART::GraphicObj::ToggleRecBBoxVisibility ( )

Toggles the recursive bounding box visibility.

Definition at line 55 of file graphicobj.cpp.

void VART::GraphicObj::ToggleRecVisibility ( )

Toggles the recursive object's visibility.

Definition at line 31 of file graphicobj.cpp.

References VART::Transform::ToggleRecVisibility(), and ToggleVisibility().

Referenced by VART::Transform::ToggleRecVisibility().

void VART::GraphicObj::ToggleVisibility ( )

Toggles the object's visibility.

Definition at line 27 of file graphicobj.cpp.

Referenced by ToggleRecVisibility(), and VART::Transform::ToggleRecVisibility().

Member Data Documentation

BoundingBox VART::GraphicObj::bBox
protected
ShowType VART::GraphicObj::howToShow

Defines how to show the object.

Definition at line 80 of file graphicobj.h.

unsigned int VART::GraphicObj::pickName
protected

A number that uniquely identifies the object for picking purposes.

Definition at line 88 of file graphicobj.h.

Referenced by PickName().

BoundingBox VART::GraphicObj::recBBox
protected
bool VART::GraphicObj::show
protected

Definition at line 83 of file graphicobj.h.

Referenced by VART::Dot::Dot().


The documentation for this class was generated from the following files: