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

#include <xmlscene.h>

Inheritance diagram for VART::XmlScene:
VART::Scene VART::XmlBase

Public Member Functions

 XmlScene ()
 
 ~XmlScene ()
 
bool LoadFromFile (const std::string &fileName)
 Parses the xml file. If it doesn't have errors, load scene. More...
 
bool LoadScene (const std::string &basePath)
 Load the scene based in xml archieve. More...
 
SceneNodeLoadSceneNode (XERCES_CPP_NAMESPACE::DOMNode *sceneList, const std::string &basePath)
 Load the nodes (transformations, geometry, etc.) of the scene. More...
 
MeshObjectLoadMeshFromFile (std::string filen, std::string type, std::string meshName)
 Load MeshObjects from file. More...
 
void loadDofs (XERCES_CPP_NAMESPACE::DOMNode *node, std::list< Dof * > *dofs)
 Load the dofs of the joint. More...
 
- Public Member Functions inherited from VART::Scene
 Scene ()
 
virtual ~Scene ()
 Destructor. More...
 
std::list< const Light * > GetLights ()
 
std::list< Camera * > GetCameras ()
 Returns a list of cameras. More...
 
void AddLight (Light *newLight)
 Adds a light to the list of lights. More...
 
void AddLight (const Light &newLight)
 Adds a light to the list of lights. More...
 
void AddCamera (Camera *newCamera)
 Add a camera to the list of cameras. More...
 
void AddObject (SceneNode *newObjectPtr)
 Add a object to the scene. More...
 
void Unreference (const SceneNode *sceneNodePtr)
 Removes an object from scene graph. More...
 
const LightGetLight (const std::string &lightName)
 Finds a light by its name. More...
 
const CameraGetCamera (const std::string &cameraName)
 Finds an camera by its description. More...
 
void SetCamera (const std::string &cameraName)
 Sets the current camera by its description. More...
 
std::list< SceneNode * > GetObjects ()
 
SceneNodeGetObject (const std::string &objectName) const
 Searches an object by its description. More...
 
SceneNodeGetObjectRec (const std::string &objectName) const
 Recursively searches an object by its description. More...
 
const ColorGetBackgroundColor ()
 Returns the background color. More...
 
void SetBackgroundColor (Color color)
 Sets the background color. More...
 
virtual bool DrawOGL (Camera *cameraPtr=NULL) const
 Sets projection and draws graphics objects using OpenGL commands. More...
 
bool DrawLightsOGL () const
 Set lights using OpenGL commands. More...
 
CameraGetCurrentCamera () const
 Returns the current camera in the scene or NULL if no camera exists. More...
 
const CameraUseNextCamera ()
 
const CameraUsePreviousCamera ()
 
void SetCamerasAspectRatio (const std::string &cameraDescription, float newAspectRatio)
 Set the aspect ratio of camera by its description. More...
 
void SetAllCamerasAspectRatio (float newAspectRatio)
 Set the aspect ratio of all cameras. More...
 
void ChangeAllCamerasViewVolume (float horScale, float verScale)
 Changes the view volume of all cameras. More...
 
bool ComputeBoundingBox ()
 Computes the axis aligned bounding box of all objects. More...
 
const BoundingBoxGetBoundingBox () const
 Returns the scene bounding box. Attention: uses the ComputeBoundingBox method to refresh value of bounding box. More...
 
void SetBBoxVisibility (bool value)
 Sets the bounding box visibility. More...
 
void SetBoundingBox (double minX, double minY, double minZ, double maxX, double maxY, double maxZ)
 Sets the bounding box. More...
 
void ToggleBBoxVisibility ()
 Toggles the bounding box visibility. More...
 
size_t GetNumLights () const
 Returns the number of light in the scene. More...
 
void MakeCameraViewAll ()
 Fits the whole scene to drawing region. More...
 
void SetDescription (const std::string &newDescr)
 Sets the scene description. More...
 
const std::string & GetDescription ()
 Returns the scene description. More...
 
std::list< SceneNode * > GetAllSceneJoints ()
 Get all scenenodes of type 'joint' in the scene. More...
 
std::list< SceneNode * > GetAllSceneTypeObject (SceneNode::TypeID type)
 Get all scenenodes of type 'type' in the scene. More...
 
void Pick (int x, int y, std::list< GraphicObj * > *resultListPtr)
 Picks objects from viewport coordinates. More...
 
void XmlPrintOn (std::ostream &os) const
 Outputs XML representation of the scene. More...
 

Additional Inherited Members

- Protected Member Functions inherited from VART::XmlBase
 XmlBase ()
 Creates an unitialized object. More...
 
bool ParseFile (const std::string &fileName)
 Checks if the file comforms to DTD. More...
 
void Terminate ()
 Terminates Xerces objects. More...
 
- Static Protected Member Functions inherited from VART::XmlBase
static bool GetAttributeValue (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *nodePtr, const char itemName[], float *valuePtr)
 Gets an item value for certain node. More...
 
static bool GetAttributeValue (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *nodePtr, const char itemName[], std::string *valuePtr)
 Gets an item value for certain node. More...
 
static bool GetAttributeValue (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *nodePtr, const char itemName[], bool *valuePtr)
 Gets an item value for certain node. More...
 
- Protected Attributes inherited from VART::Scene
std::list< const Light * > lights
 Separate lights (not treated as common objects) More...
 
std::list< Camera * > cameras
 
std::list< SceneNode * > objects
 
Color background
 
- Protected Attributes inherited from VART::XmlBase
XERCES_CPP_NAMESPACE::XercesDOMParser * parserPtr
 
XERCES_CPP_NAMESPACE::DOMDocument * documentPtr
 

Detailed Description

Definition at line 19 of file xmlscene.h.

Constructor & Destructor Documentation

VART::XmlScene::XmlScene ( )

Definition at line 23 of file xmlscene.cpp.

VART::XmlScene::~XmlScene ( )

Definition at line 887 of file xmlscene.cpp.

Member Function Documentation

void VART::XmlScene::loadDofs ( XERCES_CPP_NAMESPACE::DOMNode *  node,
std::list< Dof * > *  dofs 
)
bool VART::XmlScene::LoadFromFile ( const std::string &  fileName)

Parses the xml file. If it doesn't have errors, load scene.

Definition at line 27 of file xmlscene.cpp.

References VART::File::GetPathFromString().

VART::MeshObject * VART::XmlScene::LoadMeshFromFile ( std::string  filen,
std::string  type,
std::string  meshName 
)

Load MeshObjects from file.

Definition at line 95 of file xmlscene.cpp.

References VART::MemoryObj::autoDelete, VART::SceneNode::GetDescription(), and VART::MeshObject::ReadFromOBJ().

bool VART::XmlScene::LoadScene ( const std::string &  basePath)

Load the scene based in xml archieve.

Definition at line 57 of file xmlscene.cpp.

VART::SceneNode * VART::XmlScene::LoadSceneNode ( XERCES_CPP_NAMESPACE::DOMNode *  sceneList,
const std::string &  basePath 
)

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