mudbox::Scene Class Reference

#include <scene.h>

Inheritance diagram for mudbox::Scene:

Inheritance graph
[legend]
List of all members.

Detailed Description

The Scene class is the container object for all the data in a Mudbox scene.

All the geometry, lights, cameras, etc, are accessed and maintained through this object. To get a pointer to the current Mudbox scene, call Kernel()->Scene()


Public Member Functions

virtual const mudbox::ClassDesc *  RuntimeClass (void) const
virtual mudbox::Camera *  ActiveCamera (void) const
  Returns a pointer to the camera that is currently being used.
virtual void  SetActiveCamera (mudbox::Camera *camera)
  Sets a different camera to be active.
virtual mudbox::Light *  ActiveLight (void) const
  Returns a pointer to the currently active light.
virtual unsigned int  CameraCount (void) const
  Returns the number of cameras in the scene.
virtual unsigned int  LightCount (void) const
  Returns the number of lights in the scene.
virtual unsigned int  GeometryCount (void) const
  Returns the number of Geometry objects in the scene.
virtual unsigned int  SelectedGeometryCount (void) const
  Returns the number of Geometry objects that are currently selected.
virtual mudbox::Camera *  AddCamera (mudbox::Camera *pCamera)
  Adds a camera to the scene. Returns a pointer to the camera you added.
virtual mudbox::Light *  AddLight (mudbox::Light *pLight)
  Adds a light to the scene. Returns a pointer to the light you added.
virtual mudbox::Geometry *  AddGeometry (mudbox::Geometry *pGeometry, mudbox::Transformation *pTransformation=0)
  Adds a geometry object to the scene. Returns a pointer to the object you added.
virtual void  RemoveGeometry (mudbox::Geometry *pGeometry)
  Removes a geometry object from the scene.
virtual mudbox::Camera *  Camera (unsigned int iIndex) const
  Returns a pointer to a Camera in the scene.
virtual mudbox::Light *  Light (unsigned int iIndex) const
  Returns a pointer to a Light in the scene.
virtual mudbox::Geometry *  SelectedGeometry (unsigned int iIndex) const
  Returns a pointer to a selected Geometry object in the scene.
virtual mudbox::Geometry *  Geometry (unsigned int iIndex) const
  Returns a pointer to a Geometry object in the scene.
virtual AxisAlignedBoundingBox  BoundingBox (void) const
  Returns the bounding box of the scene.
virtual void  Render (bool bSkipMaterials=false) const
  Render the scene to the current render target using the current OpenGL pipeline settings.
virtual bool  Export (const char *sFileName, bool bSelectedOnly=false)
  Export models in the scene to an OBJ file. Returns true if successful.
virtual bool  Load (QString sFileName, bool bMerge=false, bool bMaterials=true, bool bLights=true)
  Load a MUD file into this scene. Returns true if successful.
virtual bool  Save (QString sFileName)
  Save this scene. Returns true if successful.
mudbox::Geometry *  ActiveGeometry () const
  Returns a pointer to the active object (that is, the object whose layers are displayed in the UI).
void  SetActiveGeometry (mudbox::Geometry *geometry) const
  Sets the specified geometry to be active. This means that its layers will be displayed in the UI. This is unrelated to selection.
virtual void  SetActivePaintLayer (mudbox::Layer *layer)
  Sets the specified paint layer to be active.
virtual void  SetActiveTexture (mudbox::TexturePool *layer)
  Sets the layer associated with the active texture pool to be active.
virtual mudbox::Layer *  ActivePaintLayer () const
  Returns a pointer to the currently active paint layer.
virtual mudbox::TexturePool *  ActiveTexture () const
  Returns a pointer to the currently active texture map.
virtual void  MakeThumbnail (QImage &image, int iSize=128)

Static Public Member Functions

const mudbox::ClassDesc *  StaticClass (void)
mudbox::Node *  CreateInstances (unsigned int iCount=1)

Public Attributes

aevent  m_eSceneRender

Protected Member Functions

  Scene (void)
  Do not use the constructor directly.

Constructor & Destructor Documentation

mudbox::Scene::Scene (  void   )  [protected]
 

Do not use the constructor directly.

It is unlikely that you would ever create your own scene in a plug-in. If you do need to, you should not call the constructor directly. Instead, use CreateInstances, like this:

            Scene *myNewScene = CreateInstance<Scene>();

Member Function Documentation

virtual const mudbox::ClassDesc* mudbox::Scene::RuntimeClass (  void   )  const [inline, virtual]
 

Reimplemented from mudbox::TreeNode.

00028 :
const mudbox::ClassDesc* mudbox::Scene::StaticClass (  void   )  [static]
 

Reimplemented from mudbox::TreeNode.

mudbox::Node* mudbox::Scene::CreateInstances (  unsigned int  iCount = 1  )  [static]
 

Reimplemented from mudbox::TreeNode.

virtual mudbox::Camera* mudbox::Scene::ActiveCamera (  void   )  const [virtual]
 

Returns a pointer to the camera that is currently being used.

virtual void mudbox::Scene::SetActiveCamera (  mudbox::Camera *  camera  )  [virtual]
 

Sets a different camera to be active.

virtual mudbox::Light* mudbox::Scene::ActiveLight (  void   )  const [virtual]
 

Returns a pointer to the currently active light.

virtual unsigned int mudbox::Scene::CameraCount (  void   )  const [virtual]
 

Returns the number of cameras in the scene.

virtual unsigned int mudbox::Scene::LightCount (  void   )  const [virtual]
 

Returns the number of lights in the scene.

virtual unsigned int mudbox::Scene::GeometryCount (  void   )  const [virtual]
 

Returns the number of Geometry objects in the scene.

virtual unsigned int mudbox::Scene::SelectedGeometryCount (  void   )  const [virtual]
 

Returns the number of Geometry objects that are currently selected.

virtual mudbox::Camera* mudbox::Scene::AddCamera (  mudbox::Camera *  pCamera  )  [virtual]
 

Adds a camera to the scene. Returns a pointer to the camera you added.

Once you add a camera to the scene, the scene is responsible for deleting it.

Parameters:
pCamera  [in] a pointer to an instance of a Camera
virtual mudbox::Light* mudbox::Scene::AddLight (  mudbox::Light *  pLight  )  [virtual]
 

Adds a light to the scene. Returns a pointer to the light you added.

Once you add a light to the scene, the scene is responsible for deleting it.

Parameters:
pLight  [in] a pointer to an instance of a Light
virtual mudbox::Geometry* mudbox::Scene::AddGeometry (  mudbox::Geometry *  pGeometry,
mudbox::Transformation *  pTransformation = 0
)  [virtual]
 

Adds a geometry object to the scene. Returns a pointer to the object you added.

Once you add a geometry object to the scene, the scene is responsible for deleting it.

Parameters:
pGeometry  [in] a pointer to an instance of a Geometry object
pTransformation  [in] a pointer to an instance of a Transformation for the Geometry
virtual void mudbox::Scene::RemoveGeometry (  mudbox::Geometry *  pGeometry  )  [virtual]
 

Removes a geometry object from the scene.

Note that the removed geometry is not deleted. Once the geometry is removed, it becomes the caller's responsibility to delete it.

Parameters:
pGeometry  [in] a pointer to the object that you want removed.
virtual mudbox::Camera* mudbox::Scene::Camera (  unsigned int  iIndex  )  const [virtual]
 

Returns a pointer to a Camera in the scene.

(If the index is out of range, NULL is returned. To find out how many cameras are in the scene, call CameraCount().)

Parameters:
iIndex  [in] the index of the camera to be returned (0-based)
virtual mudbox::Light* mudbox::Scene::Light (  unsigned int  iIndex  )  const [virtual]
 

Returns a pointer to a Light in the scene.

(If the index is out of range, NULL is returned. To find out how many lights are in the scene, call LightCount().)

Parameters:
iIndex  [in] the index of the light to be returned (0-based)
virtual mudbox::Geometry* mudbox::Scene::SelectedGeometry (  unsigned int  iIndex  )  const [virtual]
 

Returns a pointer to a selected Geometry object in the scene.

(If the index is out of range, NULL is returned. To find out how many geometry objects are selected in the scene, call SelectedGeometryCount().)

Parameters:
iIndex  [in] the index of the selected geometry object to be returned (0-based)
virtual mudbox::Geometry* mudbox::Scene::Geometry (  unsigned int  iIndex  )  const [virtual]
 

Returns a pointer to a Geometry object in the scene.

(If the index is out of range, NULL is returned. To find out how many geometry objects are in the scene, call GeometryCount().)

Parameters:
iIndex  [in] the index of the geometry object to be returned (0-based)
virtual AxisAlignedBoundingBox mudbox::Scene::BoundingBox (  void   )  const [virtual]
 

Returns the bounding box of the scene.

This bounding box is axis-aligned, and in World Space.

virtual void mudbox::Scene::Render (  bool  bSkipMaterials = false  )  const [virtual]
 

Render the scene to the current render target using the current OpenGL pipeline settings.

Note: This method is not part of the regular refresh cycle. To force the screen to refresh after making changes, call Kernel->Refresh()

Use this method when you need to render the scene for purposes internal to your plug-in. For example, you can create a custom texture, make it the render target (see the Texture class defined in material.h), set up whatever special shaders you need, then call this method to render the scene into your texture.

By default, objects will be rendered with their own materials. If you want to render everything with a shader that you set up, set bSkipMaterials to true.

Parameters:
bSkipMaterials  [in] If true, then the materials attached to objects in the scene are ignored. Everything uses the current shader.
virtual bool mudbox::Scene::Export (  const char *  sFileName,
bool  bSelectedOnly = false
)  [virtual]
 

Export models in the scene to an OBJ file. Returns true if successful.

Parameters:
sFileName  [in] The path to the file to be saved (with a .obj extension)
bSelectedOnly  [in] If true, only selected models will be saved
virtual bool mudbox::Scene::Load (  QString  sFileName,
bool  bMerge = false,
bool  bMaterials = true,
bool  bLights = true
)  [virtual]
 

Load a MUD file into this scene. Returns true if successful.

Parameters:
sFileName  [in] The path to the MUD file to be loaded
bMerge  [in] If true, the file being read in is merged with the current scene.
bMaterials  [in] Set false to exclude materials from being loaded
bLights  [in] Set false to exclude lights from being loaded
virtual bool mudbox::Scene::Save (  QString  sFileName  )  [virtual]
 

Save this scene. Returns true if successful.

Parameters:
sFileName  [in] The path to the MUD file to be saved (with a .mud extension )
mudbox::Geometry* mudbox::Scene::ActiveGeometry (   )  const
 

Returns a pointer to the active object (that is, the object whose layers are displayed in the UI).

Note that the 'active' object is unrelated to 'selected' objects. 'Active' refers to the object that is currently the focus of the user interface. For example, only one object at a time displays its layer information --- this is the active object.

void mudbox::Scene::SetActiveGeometry (  mudbox::Geometry *  geometry  )  const
 

Sets the specified geometry to be active. This means that its layers will be displayed in the UI. This is unrelated to selection.

Parameters:
geometry  [in] a pointer to the geometry to be made active
virtual void mudbox::Scene::SetActivePaintLayer (  mudbox::Layer *  layer  )  [virtual]
 

Sets the specified paint layer to be active.

Parameters:
layer  [in] A pointer to the layer to be made active
virtual void mudbox::Scene::SetActiveTexture (  mudbox::TexturePool *  layer  )  [virtual]
 

Sets the layer associated with the active texture pool to be active.

Parameters:
layer  [in] A pointer to the texture to be made active
virtual mudbox::Layer* mudbox::Scene::ActivePaintLayer (   )  const [virtual]
 

Returns a pointer to the currently active paint layer.

virtual mudbox::TexturePool* mudbox::Scene::ActiveTexture (   )  const [virtual]
 

Returns a pointer to the currently active texture map.

virtual void mudbox::Scene::MakeThumbnail (  QImage &  image,
int  iSize = 128
)  [virtual]
 

Member Data Documentation

aevent mudbox::Scene::m_eSceneRender
 

mudbox::Scene mudbox::Scene mudbox::Scene mudbox::Scene mudbox::Scene mudbox::Scene mudbox::Scene mudbox::Scene mudbox::Scene mudbox::Scene
mudbox::Scene mudbox::Scene mudbox::Scene mudbox::Scene mudbox::Scene mudbox::Scene mudbox::Scene mudbox::Scene mudbox::Scene mudbox::Scene