Clarisse 4.0 SP10 SDK  4.0.0.0.10
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | List of all members
GeometryObject Class Referenceabstract

Class defining the GeometryObject object, which is the base object in Clarisse to define a geometry. More...

Inheritance diagram for GeometryObject:
ResourceData EventObject CoreCustomData CoreBaseObject CoreBaseType CurveMesh DisplacementMesh GeometryBox GeometryCylinder GeometryDisk GeometrySphere GeometrySquare OsdMesh ParticleCloud PolyMesh PolyMeshSmoothed TubeMesh

Public Member Functions

 GeometryObject (const GeometryObject &other)
 
virtual GeometryObjectget_copy () const =0
 Get a copy of the current geometry.
 
virtual GMathBbox3d get_bbox () const =0
 Get bounding box of the geometry.
 
virtual GMathBbox3d get_bbox_at (const CtxEval &eval_ctx, const double &time) const
 Get the bounding box of the geometry for the given time.
 
virtual const CoreBasicArray
< CoreString > & 
get_shading_group_names () const =0
 Get the list of shading groups defined in the geometry.
 
virtual GMathBbox3d get_shading_group_bbox (const unsigned int &id) const
 Get the bounding box of a shading group.
 
virtual void get_primitive_indices (CoreArray< unsigned int > &indices) const
 Get the list of vertex indices that define all primitives.
 
virtual bool is_animated () const
 Indicate if the geometry has an animation for the current frame.
 
virtual const GeometryPointCloudget_point_cloud () const
 Get the point cloud defined by the geometry.
 
virtual bool set_point_cloud (const GeometryPointCloud &point_cloud, AppProgressBar *progress_bar=0)
 Replace the point cloud.
 
virtual unsigned int get_vertex_count () const
 Get the number of vertices in the geometry.
 
virtual unsigned int get_primitive_count () const =0
 Get the number of primitives in the geometry.
 
virtual unsigned int get_primitive_edge_count (const unsigned int &id) const =0
 Get the number of edges of a primitive.
 
virtual void compute_primitive_bbox (const CtxEval &eval_ctx, const unsigned int &id, GMathBbox3d &bbox) const =0
 Compute the bounding box of a primitive.
 
virtual void compute_primitive_bbox_at (const CtxEval &eval_ctx, const unsigned int &id, const double &time, GMathBbox3d &bbox) const
 Compute the bounding box of a primitive at a given time.
 
virtual double estimate_area (const CtxEval &eval_ctx, const GMathMatrix4x4d &xform) const
 Compute an estimation of the area of the geometry.
 
virtual double estimate_shading_group_area (const CtxEval &eval_ctx, const unsigned int &id, const GMathMatrix4x4d &xform) const
 Compute an estimation of the area of a shading group.
 
virtual double estimate_primitive_area (const CtxEval &eval_ctx, const unsigned int &id, const GMathMatrix4x4d &xform) const
 Compute an estimation of the area of a primitive.
 
virtual unsigned int get_primitive_shading_group_index (const unsigned int &id) const =0
 Get the ID of the shading group to which belongs a primitive.
 
const CoreStringget_primitive_shading_group_name (const unsigned int &id) const
 Get the name of the shading group to which belongs a primitive.
 
virtual unsigned int get_uv_map_count () const
 Get the number of UV maps defined in the geometry.
 
virtual const CoreStringget_uv_map_name (const unsigned int &uv_map_index) const
 Get the name of a UV map.
 
bool get_uv_map_index (const CoreString &uv_map_name, unsigned int &uv_map_index) const
 Get the index of a UV map by name.
 
virtual bool get_uv_map_data (const unsigned int &uv_map_index, CoreArray< GMathVec3f > &uvs, CoreArray< unsigned int > &indices) const
 Get the data of a UV map.
 
bool get_uv_map (const unsigned int &uv_map_index, GeometryUvMap &uv_map) const
 Get a UV map.
 
void get_uv_maps (CoreArray< GeometryUvMap > &uv_maps) const
 Get all UV maps.
 
virtual void compute_fragment_uvw (const CtxEval &eval_ctx, const GeometryFragment &fragment, const unsigned int &uv_map_index, GMathVec3d &coord, GMathVec3d &dcdu, GMathVec3d &dcdv) const
 Compute UVW coordinates and derivatives in a UV map for the requested fragment.
 
virtual void compute_edge_uvw (const CtxEval &eval_ctx, const unsigned int &primitive_index, const unsigned int &edge_index, const unsigned int &uv_map_index, const double &t, GMathVec3d &coord) const
 Compute UVW coordinates and derivatives in a UV map on an edge.
 
virtual unsigned int get_color_map_count () const
 Get the number of color maps defined in the geometry.
 
virtual const CoreStringget_color_map_name (const unsigned int &color_map_index) const
 Get the name of a color map.
 
virtual bool get_color_map_data (const unsigned int &color_map_index, CoreArray< GMathVec4uc > &colors, CoreArray< unsigned int > &indices) const
 Get the data of a color map.
 
bool get_color_map (const unsigned int &color_map_index, GeometryColorMap &color_map) const
 Get a color map.
 
void get_color_maps (CoreArray< GeometryColorMap > &color_maps) const
 Get all color maps.
 
virtual void compute_fragment_color (const CtxEval &eval_ctx, const GeometryFragment &fragment, const unsigned int &color_map_index, GMathVec4f &color) const
 Compute the value of a color map for the requested fragment.
 
virtual unsigned int get_normal_map_count () const
 Get the number of normal maps defined in the geometry.
 
virtual const CoreStringget_normal_map_name (const unsigned int &normal_map_index) const
 Get the name of a normal map.
 
virtual bool get_normal_map_data (const unsigned int &normal_map_index, CoreArray< GMathVec3f > &normals, CoreArray< unsigned int > &indices) const
 Get the description of a normal map.
 
bool get_normal_map (const unsigned int &normal_map_index, GeometryNormalMap &normal_map) const
 Get a normal map.
 
void get_normal_maps (CoreArray< GeometryNormalMap > &normal_maps) const
 Get all normal maps.
 
virtual bool is_primitive_uv_mapped (const unsigned int &primitive_id, const unsigned int &uv_map_index) const
 Tell if a primitive has a representation in a UV map.
 
virtual bool is_primitive_edge_visible (const unsigned int &primitive_index, const unsigned int &edge_index) const
 Tell if an edge is visible.
 
virtual bool is_geometry_linear () const
 Tell if the geometry is linear.
 
virtual bool is_primitive_linear (const unsigned int &primitive_index) const
 Tell if a primitive is linear.
 
virtual bool is_primitive_edge_linear (const unsigned int &primitive_index, const unsigned int &edge_index) const
 Tell if an edge on a primitive is linear.
 
virtual void compute_fragment_sample (const CtxEval &eval_ctx, const GeometryFragment &fragment, GeometrySample &sample) const =0
 Compute a sample (position, derivatives, normals) on the geometry for a given fragment.
 
virtual void compute_edge_sample (const CtxEval &eval_ctx, const unsigned int &primitive_id, const unsigned int &edge_index, const double &t, const GMathVec3d &eye_dir, GeometrySample &sample) const
 Compute a sample (position, derivatives, normals) on an edge of the geometry.
 
virtual void intersect_primitive (const CtxEval &eval_ctx, const unsigned int &id, GeometryRaytraceCtx &raytrace_ctx) const =0
 Compute the list of intersections between rays and a primitive.
 
virtual void intersect_primitive (const CtxEval &eval_ctx, const unsigned int &id, GeometryFrustumCtx &frustum_ctx) const
 Compute the intersection between a frustum and a primitive.
 
void get_uv_tiles (const GeometryUvMap &uv_map, CoreArray< GeometryUvTile > &tiles) const
 Get the non empty UV tiles from a uv map.
 
void get_uv_tiles (const int &index, CoreArray< GeometryUvTile > &tiles) const
 Get the non empty UV tiles from the geometry's uv map at an index.
 
GMathVec4f get_uv_range (const GeometryUvMap &uv_map) const
 
GMathVec4f get_uv_range (const unsigned int &uv_map_index) const
 
- Public Member Functions inherited from ResourceData
 ResourceData (const ResourceData &other)
 
virtual size_t get_memory_size () const
 Get the amount of memory occupied by the resource.
 
ResourceImportDataget_import_data () const
 
void set_import_data (ResourceImportData *data)
 
virtual Core128BitHashKey get_hash_key () const
 Get the hash key of the resource.
 
virtual bool is_serializable () const
 Tell if the resource can be serialized or not.
 
virtual void * serialize (size_t &serial_size) const
 Serialize the resource data.
 
virtual bool deserialize (void *serial, const size_t &serial_size)
 Deserialize the resource data.
 
void advert_memory_changed () const
 Adverts that the memory usage of the resource has changed.
 
bool is_protected () const
 
- Public Member Functions inherited from EventObject
 EventObject ()
 Constructor.
 
 EventObject (const EventObject &src)
 Copy Constructor.
 
virtual ~EventObject ()
 Destructor.
 
void connect (EventObject &sender, const CoreString &event_id, EventMethod event_cb, void *data=0)
 Connects this to an object to listen to a specific event.
 
void connect (EventObject &sender, EventMethod event_cb, void *data=0)
 Connects this to an object to listen any of its events.
 
void raise_event (const CoreString &event_id) const
 sends an event
 
void connect (EventObject &sender, const CoreString &event_id, EventInfoMethod event_cb, void *data=0)
 Connects this to an object to listen to a specific event.
 
void connect (EventObject &sender, EventInfoMethod event_cb, void *data=0)
 Connects this to an object to listen any of its events.
 
void raise_event (const EventInfo &event_info) const
 sends an event
 
bool disconnect_all (EventObject &sender)
 Disconnects from all objects sender was listening on.
 
void disconnect_all ()
 Disconnects from all objects we were listening on.
 
void remove_all_connection ()
 Disconnects object from other objects it is listening to, and also disconnects all objects listening to it.
 
bool is_connected (EventObject &sender, const CoreString &event_id, void *data)
 
void set_mute (const bool &mute)
 Asks for object muting. This will increase or decrease the muting counter. Unmuting may not be immediat since it will happen only when counter reaches 0.
 
bool is_mute () const
 Returns if object is muted.
 
bool disconnect (EventObject &sender, const CoreString &event_id, EventMethod event_cb, void *data=0)
 Disconnects this from an object for a specific event.
 
bool disconnect (EventObject &sender, const CoreString &event_id, EventInfoMethod event_cb, void *data=0)
 
unsigned int get_sender_count () const
 
unsigned int get_receiver_count () const
 
- Public Member Functions inherited from CoreCustomData
 CoreCustomData (const CoreCustomData &src)
 
void add_custom_data (void *key, const bool &data)
 
void add_custom_data (void *key, const int &data)
 
void add_custom_data (void *key, const unsigned int &data)
 
void add_custom_data (void *key, const char *data)
 
void add_custom_data (void *key, const CoreString &data)
 
void add_custom_data (void *key, const double &data)
 
void add_custom_data (void *key, void *data)
 
void remove_custom_data (void *key)
 
void remove_all_custom_data ()
 
void set_custom_data (void *key, const bool &data)
 
void set_custom_data (void *key, const int &data)
 
void set_custom_data (void *key, const unsigned int &data)
 
void set_custom_data (void *key, const double &data)
 
void set_custom_data (void *key, const char *data)
 
void set_custom_data (void *key, const CoreString &data)
 
void set_custom_data (void *key, void *data)
 
void get_custom_data (void *key, bool &data) const
 
void get_custom_data (void *key, int &data) const
 
void get_custom_data (void *key, unsigned int &data) const
 
void get_custom_data (void *key, double &data) const
 
void get_custom_data (void *key, CoreString &data) const
 
void get_custom_data (void *key, void *&data) const
 
- Public Member Functions inherited from CoreBaseObject
bool is_kindof (const CoreBaseObject &object) const
 
CoreString get_class_info_name () const
 
CoreString get_class_interface () const
 
const unsigned long & get_class_info_id () const
 
bool is_kindof (const CoreClassInfo &cinfo) const
 
virtual const CoreClassInfoget_class_info () const
 
bool operator== (const CoreBaseObject &obj) const
 
template<class T >
T * cast ()
 
template<class T >
const T * cast () const
 
- Public Member Functions inherited from CoreBaseType
bool is_kindof (const CoreClassInfo &cinfo) const
 
bool operator== (const CoreBaseType &obj) const
 

Additional Inherited Members

- Public Types inherited from EventObject
typedef void(* EventInfoFunction )(EventObject &, const EventInfo &, void *)
 
typedef void(EventObject::* EventInfoMethod )(EventObject &, const EventInfo &, void *)
 
typedef void(* EventFunction )(EventObject &, const CoreString &, void *)
 
typedef void(EventObject::* EventMethod )(EventObject &, const CoreString &, void *)
 
- Static Public Member Functions inherited from EventObject
static void connect (EventObject &sender, const CoreString &event_id, EventObject &receiver, EventMethod event_cb, void *data=0)
 Static version of the above function.
 
static void connect (EventObject &sender, EventObject &receiver, EventMethod event_cb, void *data=0)
 Static version of the above function.
 
static void connect (EventObject &sender, const CoreString &event_id, EventObject &receiver, EventInfoMethod event_cb, void *data=0)
 Static version of the above function.
 
static void connect (EventObject &sender, EventObject &receiver, EventInfoMethod event_cb, void *data=0)
 Static version of the above function.
 
static void raise_event (EventObject &sender, const CoreString &event_id)
 Sends an event.
 
static void raise_event (EventObject &sender, const EventInfo &event_info)
 Sends an event.
 
static void connect (EventObject &sender, const CoreString &event_id, EventFunction event_cb, void *data=0)
 Connects to an object to listen to a specific event.
 
static void connect (EventObject &sender, EventFunction event_cb, void *data=0)
 Connects to an object to listen any of its events.
 
static void connect (EventObject &sender, const CoreString &event_id, EventInfoFunction event_cb, void *data=0)
 Connects to an object to listen to a specific event.
 
static void connect (EventObject &sender, EventInfoFunction event_cb, void *data=0)
 Connects to an object to listen any of its events.
 
static bool disconnect (EventObject &sender, const CoreString &event_id, EventFunction event_cb, void *data=0)
 Disconnects this from an object for a specific event.
 
static bool disconnect (EventObject &sender, const CoreString &event_id, EventInfoFunction event_cb, void *data=0)
 

Detailed Description

Class defining the GeometryObject object, which is the base object in Clarisse to define a geometry.

Member Function Documentation

void GeometryObject::compute_edge_sample ( const CtxEval eval_ctx,
const unsigned int &  primitive_id,
const unsigned int &  edge_index,
const double &  t,
const GMathVec3d &  eye_dir,
GeometrySample sample 
) const
virtual

Compute a sample (position, derivatives, normals) on an edge of the geometry.

Parameters
[in]eval_ctxa valid evaluation context
[in]primitive_idthe ID of the primitive to which the edge belongs
[in]edge_indexthe ID of the edge on the primitive
[in]tposition on the edge [0 - 1.0]
[in]eye_dirthe direction from which the edge is viewed
[out]sampleoutput sample
void GeometryObject::compute_edge_uvw ( const CtxEval eval_ctx,
const unsigned int &  primitive_index,
const unsigned int &  edge_index,
const unsigned int &  uv_map_index,
const double &  t,
GMathVec3d &  coord 
) const
virtual

Compute UVW coordinates and derivatives in a UV map on an edge.

Parameters
[in]eval_ctxa valid evaluation context
[in]primitive_indexthe ID of the primitive to which the edge belongs
[in]edge_indexthe ID of the edge on the primitive
[in]uv_map_indexthe ID of the UV map to use
[in]tposition on the edge [0 - 1.0]
[out]coordoutput UVW coordinates in the UV map

Reimplemented in DisplacementMesh, CurveMesh, GeometryCylinder, OsdMesh, GeometrySphere, PolyMeshSmoothed, GeometryBox, TubeMesh, and PolyMesh.

void GeometryObject::compute_fragment_color ( const CtxEval eval_ctx,
const GeometryFragment fragment,
const unsigned int &  color_map_index,
GMathVec4f &  color 
) const
virtual

Compute the value of a color map for the requested fragment.

Parameters
[in]eval_ctxa valid evaluation context
[in]fragmentthe requested fragment
[in]color_map_indexthe ID of the color map to use
[out]coloroutput value

Reimplemented in DisplacementMesh, CurveMesh, PolyMeshSmoothed, OsdMesh, PolyMesh, and TubeMesh.

virtual void GeometryObject::compute_fragment_sample ( const CtxEval eval_ctx,
const GeometryFragment fragment,
GeometrySample sample 
) const
pure virtual

Compute a sample (position, derivatives, normals) on the geometry for a given fragment.

Parameters
[in]eval_ctxa valid evaluation context
[in]fragmentthe requested fragment
[out]sampleoutput sample

Implemented in DisplacementMesh, PolyMeshSmoothed, OsdMesh, PolyMesh, CurveMesh, GeometryCylinder, GeometryBox, ParticleCloud, GeometrySphere, GeometryDisk, GeometrySquare, TubeMeshNakamaru, TubeMeshFixed, RibbonMeshNakamaru, RibbonMesh, and TubeMesh3d.

void GeometryObject::compute_fragment_uvw ( const CtxEval eval_ctx,
const GeometryFragment fragment,
const unsigned int &  uv_map_index,
GMathVec3d &  coord,
GMathVec3d &  dcdu,
GMathVec3d &  dcdv 
) const
virtual

Compute UVW coordinates and derivatives in a UV map for the requested fragment.

Parameters
[in]eval_ctxa valid evaluation context
[in]fragmentthe requested fragment
[in]uv_map_indexthe ID of the UV map to use
[out]coordoutput UVW coordinates in the UV map
[out]dcducoordinates derivative along the primitive parametric U axis
[out]dcdvcoordinates derivative along the primitive parametric V axis

Reimplemented in DisplacementMesh, CurveMesh, OsdMesh, PolyMeshSmoothed, GeometryBox, TubeMesh, and PolyMesh.

virtual void GeometryObject::compute_primitive_bbox ( const CtxEval eval_ctx,
const unsigned int &  id,
GMathBbox3d &  bbox 
) const
pure virtual

Compute the bounding box of a primitive.

Parameters
[in]eval_ctxa valid evaluation context
[in]idthe ID of the primitive
[out]bboxthe returned bounding box

Implemented in DisplacementMesh, PolyMeshSmoothed, OsdMesh, PolyMesh, ParticleCloud, CurveMesh, GeometryDisk, GeometryBox, GeometrySphere, GeometrySquare, GeometryCylinder, TubeMeshNakamaru, and TubeMeshFixed.

void GeometryObject::compute_primitive_bbox_at ( const CtxEval eval_ctx,
const unsigned int &  id,
const double &  time,
GMathBbox3d &  bbox 
) const
virtual

Compute the bounding box of a primitive at a given time.

Parameters
[in]eval_ctxa valid evaluation context
[in]idthe ID of the primitive
[in]timethe local time (relative to the current frame)
[out]bboxthe returned bounding box

Reimplemented in DisplacementMesh, PolyMeshSmoothed, OsdMesh, PolyMesh, TubeMeshNakamaru, and TubeMeshFixed.

double GeometryObject::estimate_area ( const CtxEval eval_ctx,
const GMathMatrix4x4d &  xform 
) const
virtual

Compute an estimation of the area of the geometry.

Parameters
[in]eval_ctxa valid evaluation context
[in]xformthe transformation matrix of the geometry
Returns
an estimation of the area

Reimplemented in DisplacementMesh, PolyMeshSmoothed, OsdMesh, PolyMesh, GeometryCylinder, GeometryBox, GeometrySphere, GeometryDisk, and GeometrySquare.

double GeometryObject::estimate_primitive_area ( const CtxEval eval_ctx,
const unsigned int &  id,
const GMathMatrix4x4d &  xform 
) const
virtual

Compute an estimation of the area of a primitive.

Parameters
[in]eval_ctxa valid evaluation context
[in]idthe ID of the primitive
[in]xformthe transformation matrix of the geometry
Returns
an estimation of the area

Reimplemented in DisplacementMesh, PolyMeshSmoothed, OsdMesh, PolyMesh, GeometryCylinder, GeometryBox, GeometrySphere, CurveMesh, GeometryDisk, GeometrySquare, TubeMeshNakamaru, and TubeMeshFixed.

double GeometryObject::estimate_shading_group_area ( const CtxEval eval_ctx,
const unsigned int &  id,
const GMathMatrix4x4d &  xform 
) const
virtual

Compute an estimation of the area of a shading group.

Parameters
[in]eval_ctxa valid evaluation context
[in]idthe ID of the shading group
[in]xformthe transformation matrix of the geometry
Returns
an estimation of the area

Reimplemented in DisplacementMesh, PolyMeshSmoothed, OsdMesh, PolyMesh, GeometryCylinder, GeometryBox, GeometrySphere, GeometryDisk, and GeometrySquare.

virtual GMathBbox3d GeometryObject::get_bbox ( ) const
pure virtual

Get bounding box of the geometry.

Returns
the bounding box

Implemented in OsdMesh, ParticleCloud, GeometryDisk, DisplacementMesh, PolyMesh, GeometrySquare, CurveMesh, GeometrySphere, GeometryBox, TubeMesh, GeometryCylinder, and PolyMeshSmoothed.

GMathBbox3d GeometryObject::get_bbox_at ( const CtxEval eval_ctx,
const double &  time 
) const
virtual

Get the bounding box of the geometry for the given time.

Parameters
[in]eval_ctxa valid evaluation context
[in]timethe local time (relative to the current frame)
Returns
the bounding box

Reimplemented in OsdMesh, ParticleCloud, DisplacementMesh, PolyMesh, and PolyMeshSmoothed.

bool GeometryObject::get_color_map ( const unsigned int &  color_map_index,
GeometryColorMap color_map 
) const

Get a color map.

Parameters
[in]color_map_indexthe index of the map to retrieve
[out]color_mapthe corresponding map
Returns
true if the map exists, else false
virtual unsigned int GeometryObject::get_color_map_count ( ) const
inlinevirtual

Get the number of color maps defined in the geometry.

Returns
the number of color maps

Reimplemented in DisplacementMesh, CurveMesh, OsdMesh, PolyMeshSmoothed, PolyMesh, and TubeMesh.

virtual bool GeometryObject::get_color_map_data ( const unsigned int &  color_map_index,
CoreArray< GMathVec4uc > &  colors,
CoreArray< unsigned int > &  indices 
) const
inlinevirtual

Get the data of a color map.

Parameters
[in]color_map_indexthe ID of the color map
[out]colorsthe array of colors
[out]indicesthe indices to the colors for each primitive
Returns
true if the description for the color map can be retrieved, else false

Reimplemented in PolyMeshSmoothed, OsdMesh, and PolyMesh.

const CoreString & GeometryObject::get_color_map_name ( const unsigned int &  color_map_index) const
virtual

Get the name of a color map.

Parameters
[in]color_map_indexthe ID of the color map
Returns
the name of the color map

Reimplemented in DisplacementMesh, CurveMesh, OsdMesh, PolyMeshSmoothed, PolyMesh, and TubeMesh.

void GeometryObject::get_color_maps ( CoreArray< GeometryColorMap > &  color_maps) const

Get all color maps.

Parameters
[out]color_mapsthe array of maps
virtual GeometryObject* GeometryObject::get_copy ( ) const
pure virtual

Get a copy of the current geometry.

Returns
a new object that is the copy of the current one

Implemented in OsdMesh, ParticleCloud, GeometryDisk, DisplacementMesh, PolyMesh, GeometrySquare, CurveMesh, TubeMeshNakamaru, GeometryBox, GeometryCylinder, GeometrySphere, PolyMeshSmoothed, RibbonMeshNakamaru, TubeMeshFixed, RibbonMesh, and TubeMesh3d.

bool GeometryObject::get_normal_map ( const unsigned int &  normal_map_index,
GeometryNormalMap normal_map 
) const

Get a normal map.

Parameters
[in]normal_map_indexthe index of the map to retrieve
[out]normal_mapthe corresponding map
Returns
true if the map exists, else false
virtual unsigned int GeometryObject::get_normal_map_count ( ) const
inlinevirtual

Get the number of normal maps defined in the geometry.

Returns
the number of normal maps

Reimplemented in CurveMesh, PolyMeshSmoothed, PolyMesh, and TubeMesh.

virtual bool GeometryObject::get_normal_map_data ( const unsigned int &  normal_map_index,
CoreArray< GMathVec3f > &  normals,
CoreArray< unsigned int > &  indices 
) const
inlinevirtual

Get the description of a normal map.

Parameters
[in]normal_map_indexthe ID of the normal map
[out]normalsthe array of normals
[out]indicesthe indices to the normals for each primitive
Returns
true if the description for the normal map can be retrieved, else false

Reimplemented in PolyMeshSmoothed, and PolyMesh.

const CoreString & GeometryObject::get_normal_map_name ( const unsigned int &  normal_map_index) const
virtual

Get the name of a normal map.

Parameters
[in]normal_map_indexthe ID of the normal map
Returns
the name of the normal map

Reimplemented in CurveMesh, PolyMeshSmoothed, PolyMesh, and TubeMesh.

void GeometryObject::get_normal_maps ( CoreArray< GeometryNormalMap > &  normal_maps) const

Get all normal maps.

Parameters
[out]normal_mapsthe array of maps
const GeometryPointCloud * GeometryObject::get_point_cloud ( ) const
virtual

Get the point cloud defined by the geometry.

Returns
the point cloud or null if there's none
Note
The point cloud contains the list of all vertices with some associated properties.

Reimplemented in PolyMeshSmoothed, OsdMesh, PolyMesh, DisplacementMesh, ParticleCloud, and CurveMesh.

virtual unsigned int GeometryObject::get_primitive_count ( ) const
pure virtual

Get the number of primitives in the geometry.

Returns
the number of primitives

Implemented in DisplacementMesh, PolyMeshSmoothed, OsdMesh, PolyMesh, ParticleCloud, CurveMesh, GeometryDisk, GeometrySphere, GeometryBox, GeometrySquare, TubeMeshNakamaru, GeometryCylinder, and TubeMeshFixed.

virtual unsigned int GeometryObject::get_primitive_edge_count ( const unsigned int &  id) const
pure virtual

Get the number of edges of a primitive.

Parameters
[in]idthe ID of the primitive
Returns
the number of edges for the given primitive

Implemented in DisplacementMesh, PolyMeshSmoothed, OsdMesh, PolyMesh, ParticleCloud, CurveMesh, GeometryDisk, GeometrySphere, GeometryBox, GeometrySquare, TubeMesh, and GeometryCylinder.

void GeometryObject::get_primitive_indices ( CoreArray< unsigned int > &  indices) const
virtual

Get the list of vertex indices that define all primitives.

Parameters
[out]indicesthe list of vertex indices
Note
Primitives are following each others, there are no seperator in the list. The number of index for each primitive can be known with the get_primitive_edge_count() method.

Reimplemented in PolyMeshSmoothed, OsdMesh, PolyMesh, and DisplacementMesh.

virtual unsigned int GeometryObject::get_primitive_shading_group_index ( const unsigned int &  id) const
pure virtual

Get the ID of the shading group to which belongs a primitive.

Parameters
[in]idthe ID of the primitive
Returns
the ID of the shading group

Implemented in DisplacementMesh, PolyMeshSmoothed, OsdMesh, PolyMesh, CurveMesh, ParticleCloud, GeometryDisk, GeometrySphere, GeometryBox, TubeMesh, GeometrySquare, and GeometryCylinder.

const CoreString& GeometryObject::get_primitive_shading_group_name ( const unsigned int &  id) const
inline

Get the name of the shading group to which belongs a primitive.

Parameters
[in]idthe ID of the primitive
Returns
the name of the shading group
GMathBbox3d GeometryObject::get_shading_group_bbox ( const unsigned int &  id) const
virtual

Get the bounding box of a shading group.

Parameters
[in]idthe ID of the shading group
Returns
the bounding box of the shading group

Reimplemented in OsdMesh, DisplacementMesh, PolyMesh, PolyMeshSmoothed, and TubeMesh.

virtual const CoreBasicArray<CoreString>& GeometryObject::get_shading_group_names ( ) const
pure virtual

Get the list of shading groups defined in the geometry.

Returns
the array of shading group names

Implemented in DisplacementMesh, OsdMesh, ParticleCloud, GeometryDisk, PolyMesh, CurveMesh, GeometrySphere, PolyMeshSmoothed, GeometrySquare, TubeMesh, GeometryBox, and GeometryCylinder.

bool GeometryObject::get_uv_map ( const unsigned int &  uv_map_index,
GeometryUvMap uv_map 
) const

Get a UV map.

Parameters
[in]uv_map_indexthe index of the map to retrieve
[out]uv_mapthe corresponding map
Returns
true if the map exists, else false
virtual unsigned int GeometryObject::get_uv_map_count ( ) const
inlinevirtual

Get the number of UV maps defined in the geometry.

Returns
the number of UV maps

Reimplemented in DisplacementMesh, CurveMesh, OsdMesh, GeometryBox, PolyMesh, PolyMeshSmoothed, and TubeMesh.

virtual bool GeometryObject::get_uv_map_data ( const unsigned int &  uv_map_index,
CoreArray< GMathVec3f > &  uvs,
CoreArray< unsigned int > &  indices 
) const
inlinevirtual

Get the data of a UV map.

Parameters
[in]uv_map_indexthe ID of the UV map
[out]uvsthe array of UVs
[out]indicesthe indices to the UVs for each primitive
Returns
true if the data for the UV map can be retrieved, else false

Reimplemented in OsdMesh, GeometryBox, PolyMeshSmoothed, and PolyMesh.

bool GeometryObject::get_uv_map_index ( const CoreString uv_map_name,
unsigned int &  uv_map_index 
) const

Get the index of a UV map by name.

Parameters
[in]uv_map_namethe name of the map to retrieve
[out]uv_map_indexthe corresponding index, remains unchanged if the map is not found
Returns
true if the map exists, else false
const CoreString & GeometryObject::get_uv_map_name ( const unsigned int &  uv_map_index) const
virtual

Get the name of a UV map.

Parameters
[in]uv_map_indexthe ID of the UV map
Returns
the name of the UV map

Reimplemented in DisplacementMesh, CurveMesh, OsdMesh, GeometryBox, PolyMeshSmoothed, PolyMesh, and TubeMesh.

void GeometryObject::get_uv_maps ( CoreArray< GeometryUvMap > &  uv_maps) const

Get all UV maps.

Parameters
[out]uv_mapsthe array of maps
GMathVec4f GeometryObject::get_uv_range ( const GeometryUvMap uv_map) const

Get the UV range from the geometry's uv map.

If no UVs or UV map not found, returns (0, 0, 0, 0).

Parameters
[in]uv_mapthe corresponding map
Returns
UV range as a GMathVec4f where values are in this order: U min, V min, U max, V max
GMathVec4f GeometryObject::get_uv_range ( const unsigned int &  uv_map_index) const

Get the UV range from the geometry's uv map at an index.

If no UVs or UV map index not found, returns (0, 0, 0, 0).

Parameters
[in]uv_map_indexthe index of the object's uv map
Returns
UV range as a GMathVec4f where values are in this order: U min, V min, U max, V max
void GeometryObject::get_uv_tiles ( const GeometryUvMap uv_map,
CoreArray< GeometryUvTile > &  tiles 
) const

Get the non empty UV tiles from a uv map.

Parameters
[in]uv_mapthe uv map containing the tiles
[out]tilesthe result array of UV tiles
void GeometryObject::get_uv_tiles ( const int &  index,
CoreArray< GeometryUvTile > &  tiles 
) const

Get the non empty UV tiles from the geometry's uv map at an index.

Parameters
[in]indexthe index of the object's uv map containing the tiles
[out]tilesthe result array of UV tiles
unsigned int GeometryObject::get_vertex_count ( ) const
virtual

Get the number of vertices in the geometry.

Returns
the number of vertices

Reimplemented in PolyMeshSmoothed, DisplacementMesh, OsdMesh, PolyMesh, ParticleCloud, CurveMesh, and GeometryBox.

virtual void GeometryObject::intersect_primitive ( const CtxEval eval_ctx,
const unsigned int &  id,
GeometryRaytraceCtx raytrace_ctx 
) const
pure virtual

Compute the list of intersections between rays and a primitive.

Parameters
[in]eval_ctxa valid evaluation context
[in]idthe ID of the primitive
[in,out]raytrace_ctxthe context containing rays information and output results

Implemented in DisplacementMesh, PolyMeshSmoothed, OsdMesh, PolyMesh, CurveMesh, ParticleCloud, GeometryBox, GeometrySphere, GeometryDisk, GeometrySquare, TubeMeshNakamaru, GeometryCylinder, TubeMeshFixed, RibbonMeshNakamaru, RibbonMesh, and TubeMesh3d.

void GeometryObject::intersect_primitive ( const CtxEval eval_ctx,
const unsigned int &  id,
GeometryFrustumCtx frustum_ctx 
) const
virtual

Compute the intersection between a frustum and a primitive.

Parameters
[in]eval_ctxa valid evaluation context
[in]idthe ID of the primitive
[in,out]frustum_ctxthe context containing the frustum information and the output result

Reimplemented in DisplacementMesh, PolyMeshSmoothed, OsdMesh, PolyMesh, GeometryBox, GeometrySphere, TubeMeshNakamaru, GeometryCylinder, and TubeMeshFixed.

bool GeometryObject::is_animated ( ) const
virtual

Indicate if the geometry has an animation for the current frame.

Returns
true if the geometry is animated, else false

Reimplemented in OsdMesh, PolyMesh, DisplacementMesh, ParticleCloud, CurveMesh, PolyMeshSmoothed, and TubeMesh.

virtual bool GeometryObject::is_geometry_linear ( ) const
inlinevirtual

Tell if the geometry is linear.

Returns
true if the geometry is linear, else false

Reimplemented in DisplacementMesh, PolyMeshSmoothed, OsdMesh, PolyMesh, and GeometryBox.

virtual bool GeometryObject::is_primitive_edge_linear ( const unsigned int &  primitive_index,
const unsigned int &  edge_index 
) const
inlinevirtual

Tell if an edge on a primitive is linear.

Parameters
[in]primitive_indexthe ID of the primitive to which the edge belongs
[in]edge_indexthe ID of the edge in the primitive
Returns
true if the edge is linear, else false

Reimplemented in DisplacementMesh, PolyMeshSmoothed, OsdMesh, PolyMesh, and GeometryBox.

virtual bool GeometryObject::is_primitive_edge_visible ( const unsigned int &  primitive_index,
const unsigned int &  edge_index 
) const
inlinevirtual

Tell if an edge is visible.

Parameters
[in]primitive_indexthe ID of the primitive to which the edge belongs
[in]edge_indexthe ID of the edge in the primitive
Returns
true if the edge is visible, else false

Reimplemented in DisplacementMesh, PolyMeshSmoothed, OsdMesh, and PolyMesh.

virtual bool GeometryObject::is_primitive_linear ( const unsigned int &  primitive_index) const
inlinevirtual

Tell if a primitive is linear.

Parameters
[in]primitive_indexthe ID of the primitive
Returns
true if the primitive is linear, else false

Reimplemented in DisplacementMesh, PolyMeshSmoothed, OsdMesh, PolyMesh, and GeometryBox.

virtual bool GeometryObject::is_primitive_uv_mapped ( const unsigned int &  primitive_id,
const unsigned int &  uv_map_index 
) const
inlinevirtual

Tell if a primitive has a representation in a UV map.

Parameters
[in]primitive_idthe ID of the primitive
Returns
true if the primitive if mapped, else false

Reimplemented in DisplacementMesh, PolyMeshSmoothed, OsdMesh, and PolyMesh.

bool GeometryObject::set_point_cloud ( const GeometryPointCloud point_cloud,
AppProgressBar progress_bar = 0 
)
virtual

Replace the point cloud.

Parameters
[in]point_cloudthe new point cloud
[in]progress_bara progress bar (optional)
Returns
true on success (the point cloud must be compatible, i.e. it must contain the same number of vertices), else false

Reimplemented in OsdMesh, PolyMesh, ParticleCloud, and CurveMesh.