V-ART
Public Types | Public Member Functions | List of all members
VART::Box Class Reference

A box. More...

#include <box.h>

Inheritance diagram for VART::Box:
VART::MeshObject VART::GraphicObj VART::SceneNode VART::MemoryObj

Public Types

enum  faceEnum {
  BACK_FACE =0, FRONT_FACE =1, RIGHT_FACE =2, LEFT_FACE =3,
  TOP_FACE =4, BOTTOM_FACE =5, ALL_FACES =6
}
 
- 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

 Box ()
 Creates an uninitialized box. More...
 
void MakeBox (double minX, double maxX, double minY, double maxY, double minZ, double maxZ, bool oneMesh=true)
 Creates a box aligned with the 3 reference planes (XY, XZ and YZ). More...
 
void SetMaterialBoxFace (const Material &mat, int numberFace=6)
 Assigns a material to the mesh of one (or all) face of a box object. More...
 
- Public Member Functions inherited from VART::MeshObject
 MeshObject ()
 
 MeshObject (const MeshObject &obj)
 
MeshObjectoperator= (const MeshObject &obj)
 
virtual VART::SceneNodeCopy ()
 Returns a copy of an MeshObject. Every derived class must reimplements this method, to avoid errors with VART::SceneNode::RecursiveCopy. More...
 
void SetMaterial (const Material &mat)
 Assigns a material to all meshes of the mesh object. More...
 
void MakeBox (double minX, double maxX, double minY, double maxY, double minZ, double maxZ)
 Creates a box aligned with the 3 reference planes (XY, XZ and YZ). More...
 
void GetYProjection (std::list< Point4D > *resultPtr, double height=0) const
 Computes the projection of all vertices along the Y axis. More...
 
void Optimize ()
 Optimize object for display. More...
 
void Clear ()
 Erases internal structures. More...
 
void SetVertices (const std::vector< Point4D > &vertexVec)
 Sets the vector of vertices. More...
 
void SetNormals (const std::vector< Point4D > &normalVec)
 Sets the vector of normals. More...
 
void SetVertices (const char *vertexStr)
 Sets the vector of vertices. More...
 
void SetVertex (unsigned int index, const Point4D &newValue)
 Changes one vertex. More...
 
const std::vector< double > & GetVerticesCoordinates ()
 Returns the coordinates of the vertices in the object. More...
 
void AddFace (const char *indexStr)
 Adds a face (a mesh of a single polygon) based on previously set vertices. More...
 
void AddMesh (const Mesh &m)
 Adds a copy of the mesh to the object. More...
 
virtual void ComputeBoundingBox ()
 Computes the bounding box. More...
 
void ComputeBoundingBox (const Transform &trans, BoundingBox *bbPtr)
 
void ComputeSubBBoxes (const Transform &trans, int subdivisions)
 Computes de SubBBoxes and stores them. More...
 
std::vector< VART::BoundingBoxGetSubBBoxes ()
 returns the list of subdivided bounding boxes. More...
 
virtual TypeID GetID () const
 Returns type identification of the node. More...
 
void MergeWith (const MeshObject &obj)
 Merges one mesh object with another. More...
 
void ApplyTransform (const Transform &trans)
 Apply Transformation to all vertices. More...
 
bool IsEmpty ()
 Checks whether the object contains geometry data. More...
 
Point4D GetVertex (unsigned int pos)
 Returns a copy of a vertex. More...
 
void SmallerVertex (Point4D *resultPtr)
 Computes and returns the smaller vertex. More...
 
Point4D GetVertexMedia ()
 Return the Aritmethic mean of vertexes values. More...
 
void ComputeVertexNormals ()
 Computes the normal of every vertex. More...
 
unsigned int NumFaces ()
 Computes the number of faces. More...
 
- 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 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 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...
 
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...
 

Additional Inherited Members

- Static Public Member Functions inherited from VART::MeshObject
static void ComputeTriangleNormal (const Point4D &v1, const Point4D &v2, const Point4D &v3, Point4D *resultPtr)
 Computes the normal of a triangle. More...
 
static bool ReadFromOBJ (const std::string &filename, std::list< MeshObject * > *resultPtr)
 Read MeshObjects from a Wavefront OBJ file. More...
 
- 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::MeshObject
static float sizeOfNormals = 0.1f
 Size of normals for rendering (in world coordinates). More...
 
- Static Public Attributes inherited from VART::SceneNode
static bool recursivePrinting = true
 
- Protected Member Functions inherited from VART::MeshObject
virtual bool DrawInstanceOGL () const
 Non-recursive drawing - should be overriden by every derived class. More...
 
void AddNormal (unsigned int idx, const Point4D &vec)
 Adds a vector to a vertex normal. More...
 
Point4D Vertex (unsigned int i) const
 Returns a vertex as a Point4D. More...
 
void NormalizeAllNormals ()
 Normalizes all vertex normals. More...
 
- 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...
 
- Static Protected Member Functions inherited from VART::MeshObject
static void ReadVertex (std::istringstream &iss, unsigned int *vi, unsigned int *ti, unsigned int *ni)
 Reads a vertex description from a face on a OBJ file. More...
 
static void ReadMaterialTable (const std::string &filename, std::map< std::string, Material > *matMapPtr)
 
static void ReadVerticesLine (std::istringstream &input, std::list< VertexTriplet > *resultPtr)
 
- Protected Attributes inherited from VART::MeshObject
std::vector< Point4DvertVec
 Vector of all vertices. More...
 
std::vector< double > vertCoordVec
 Vector of all vertex coordinates (their coordinates in sequence). More...
 
std::vector< Point4DnormVec
 Vector of all normals. More...
 
std::vector< double > normCoordVec
 Vector of all vertex normals (their coordinates in sequence). More...
 
std::vector< float > textCoordVec
 Vector of all texture coordinates. More...
 
std::list< MeshmeshList
 List of Meshes. 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...
 

Detailed Description

A box.

Definition at line 22 of file box.h.

Member Enumeration Documentation

Enumerator
BACK_FACE 
FRONT_FACE 
RIGHT_FACE 
LEFT_FACE 
TOP_FACE 
BOTTOM_FACE 
ALL_FACES 

Definition at line 25 of file box.h.

Constructor & Destructor Documentation

VART::Box::Box ( )

Creates an uninitialized box.

Definition at line 25 of file box.cpp.

Member Function Documentation

void VART::Box::MakeBox ( double  minX,
double  maxX,
double  minY,
double  maxY,
double  minZ,
double  maxZ,
bool  oneMesh = true 
)

Creates a box aligned with the 3 reference planes (XY, XZ and YZ).

Definition at line 28 of file box.cpp.

References VART::Material::DARK_PLASTIC_GRAY(), VART::Mesh::indexVec, VART::Mesh::material, VART::Mesh::QUADS, and VART::Mesh::type.

void VART::Box::SetMaterialBoxFace ( const Material mat,
int  numberFace = 6 
)

Assigns a material to the mesh of one (or all) face of a box object.

Definition at line 111 of file box.cpp.


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