V-ART
|
A cylinder or cone. More...
#include <cylinder.h>
Public Types | |
enum | PartsID { NONE, BOTTOM, SIDES, NO_TOP, TOP, NO_SIDES, NO_BOTTOM, ALL } |
Bitmask for cylinder parts. More... | |
Public Types inherited from VART::GraphicObj | |
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 | |
Cylinder () | |
Creates an uninitialized cylinder. More... | |
Cylinder (const VART::Cylinder &cylinder) | |
VART::Cylinder & | operator= (const VART::Cylinder &cylinder) |
virtual VART::SceneNode * | Copy () |
Returns a copy of an cylinder. Every derived class must reimplements this method, to avoid errors with VART::SceneNode::RecursiveCopy. More... | |
Cylinder (float fHi, float fRad) | |
Cylinder (float fHi, float fRad, bool bS, bool bT, bool bB) | |
virtual void | ComputeBoundingBox () |
Computes the bounding box. More... | |
void | SetHeight (float h) |
void | SetRadius (float r) |
Sets the value of top and bottom radius. More... | |
void | SetTopRadius (float r) |
Sets the value of the top radius. More... | |
void | SetBottomRadius (float r) |
Sets the value of the bottom radius. More... | |
void | SetMaterial (const Material &mat) |
Material assignment. More... | |
void | SetPartsVisibility (PartsID parts) |
Sets which parts are visible. More... | |
void | TogglePartsVisibilty (PartsID parts) |
Toogle visibility of marked parts. More... | |
PartsID | GetPartsVisibility () |
Returns internal visibility state as PartsID. More... | |
void | ShowSide (bool yesno) |
void | ShowTop (bool yesno) |
void | ShowBottom (bool yesno) |
float | GetHeight () |
float | GetTopRadius () |
Returns the top radius. More... | |
float | GetBottomRadius () |
Returns the bottom radius. More... | |
Material | GetMaterial () const |
Returns of copy of the cylinder's material. More... | |
bool | ShowSide () |
bool | ShowTop () |
bool | ShowBottom () |
Public Member Functions inherited from VART::GraphicObj | |
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... | |
void | ComputeRecursiveBoundingBox () |
Computes the recursive bounding box. More... | |
const BoundingBox & | GetBoundingBox () 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 BoundingBox & | GetRecursiveBoundingBox () 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 () |
SceneNode & | operator= (const SceneNode &node) |
virtual SceneNode * | RecursiveCopy () |
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... | |
SceneNode * | FindChildByName (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... | |
Additional Inherited Members | |
Public Attributes inherited from VART::GraphicObj | |
ShowType | howToShow |
Defines how to show the object. More... | |
Public Attributes inherited from VART::MemoryObj | |
bool | autoDelete |
Static Public Attributes inherited from VART::SceneNode | |
static bool | recursivePrinting = true |
Protected Member Functions inherited from VART::SceneNode | |
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... | |
Protected Attributes inherited from VART::GraphicObj | |
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... | |
A cylinder or cone.
Cylinders are created along the z axis, with bottom at zero and top at height. Cones are considered a special case of cylinder, where the top or bottom has zero radius.
Definition at line 18 of file cylinder.h.
Bitmask for cylinder parts.
The bit meanings from right (lower) to left are: bottom disc, sides and top disc. IDs may combied using operators '&' and '|'.
Enumerator | |
---|---|
NONE | |
BOTTOM | |
SIDES | |
NO_TOP | |
TOP | |
NO_SIDES | |
NO_BOTTOM | |
ALL |
Definition at line 24 of file cylinder.h.
VART::Cylinder::Cylinder | ( | ) |
Creates an uninitialized cylinder.
Definition at line 18 of file cylinder.cpp.
VART::Cylinder::Cylinder | ( | const VART::Cylinder & | cylinder | ) |
Definition at line 22 of file cylinder.cpp.
VART::Cylinder::Cylinder | ( | float | fHi, |
float | fRad | ||
) |
Definition at line 45 of file cylinder.cpp.
References VART::GraphicObj::bBox, VART::GraphicObj::recBBox, and VART::BoundingBox::SetBoundingBox().
VART::Cylinder::Cylinder | ( | float | fHi, |
float | fRad, | ||
bool | bS, | ||
bool | bT, | ||
bool | bB | ||
) |
Definition at line 54 of file cylinder.cpp.
References VART::GraphicObj::bBox, VART::GraphicObj::recBBox, and VART::BoundingBox::SetBoundingBox().
|
virtual |
|
virtual |
Returns a copy of an cylinder. Every derived class must reimplements this method, to avoid errors with VART::SceneNode::RecursiveCopy.
Implements VART::SceneNode.
Definition at line 40 of file cylinder.cpp.
float VART::Cylinder::GetBottomRadius | ( | void | ) |
Returns the bottom radius.
Definition at line 138 of file cylinder.cpp.
float VART::Cylinder::GetHeight | ( | void | ) |
Definition at line 128 of file cylinder.cpp.
|
inline |
Returns of copy of the cylinder's material.
Definition at line 77 of file cylinder.h.
VART::Cylinder::PartsID VART::Cylinder::GetPartsVisibility | ( | ) |
Returns internal visibility state as PartsID.
Definition at line 101 of file cylinder.cpp.
float VART::Cylinder::GetTopRadius | ( | void | ) |
Returns the top radius.
Definition at line 133 of file cylinder.cpp.
VART::Cylinder & VART::Cylinder::operator= | ( | const VART::Cylinder & | cylinder | ) |
Definition at line 27 of file cylinder.cpp.
References VART::SceneNode::operator=().
|
inline |
Sets the value of the bottom radius.
Definition at line 47 of file cylinder.h.
void VART::Cylinder::SetHeight | ( | float | h | ) |
Definition at line 72 of file cylinder.cpp.
Referenced by VART::XmlScene::LoadSceneNode().
|
inline |
Material assignment.
Definition at line 50 of file cylinder.h.
Referenced by VART::XmlScene::LoadSceneNode().
void VART::Cylinder::SetPartsVisibility | ( | PartsID | parts | ) |
Sets which parts are visible.
All three bits present in the bitmask are copied to internal visibility state.
Definition at line 87 of file cylinder.cpp.
void VART::Cylinder::SetRadius | ( | float | r | ) |
Sets the value of top and bottom radius.
Definition at line 80 of file cylinder.cpp.
Referenced by VART::XmlScene::LoadSceneNode().
|
inline |
Sets the value of the top radius.
Definition at line 45 of file cylinder.h.
void VART::Cylinder::ShowBottom | ( | bool | yesno | ) |
Definition at line 122 of file cylinder.cpp.
bool VART::Cylinder::ShowBottom | ( | void | ) |
Definition at line 155 of file cylinder.cpp.
void VART::Cylinder::ShowSide | ( | bool | yesno | ) |
Definition at line 110 of file cylinder.cpp.
bool VART::Cylinder::ShowSide | ( | void | ) |
Definition at line 143 of file cylinder.cpp.
void VART::Cylinder::ShowTop | ( | bool | yesno | ) |
Definition at line 116 of file cylinder.cpp.
bool VART::Cylinder::ShowTop | ( | void | ) |
Definition at line 149 of file cylinder.cpp.
void VART::Cylinder::TogglePartsVisibilty | ( | PartsID | parts | ) |
Toogle visibility of marked parts.
Toggle visibility of all parts whose bits are set in given bitmask.
Definition at line 94 of file cylinder.cpp.