Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Protected Types | Protected Member Functions | List of all members
ModuleLayerScene Class Reference
Inheritance diagram for ModuleLayerScene:
ModuleLayer ModuleProjectItem ModuleObject OfModule ResourceUser EventObject CoreCustomData CoreBaseObject CoreBaseType ModuleLayer3d

Public Member Functions

const CoreArray
< ModuleSceneObject * > & 
get_scene_objects () const
 Returns the list of objects that are referenced by the layer scene.
 
void get_scene_objects (CoreArray< OfObjectHandle > &objects, const OfContext *working_context=0) const
 Returns the list of objects as OfObjectHandle that are referenced by the layer scene.
 
const CoreArray< ModuleLight * > & get_lights () const
 
void get_lights (CoreArray< OfObjectHandle > &lights, const OfContext *working_context=0) const
 Returns the list of lights as OfObjectHandle used by the layer scene.
 
ModuleCameraget_camera () const
 Returns the camera used by the layer scene.
 
OfObjectHandle get_camera_object () const
 Returns the camera as an OfObjectHandle used by the layer scene.
 
ModuleGroupget_scene_object_group () const
 Returns the group of scene objects.
 
ModuleGroupget_light_group () const
 Returns the group of lights.
 
ModuleShadingLayerget_shading_layer () const
 Returns the shading layer applied on the layer. May be null.
 
void set_shading_layer (ModuleShadingLayer *sl)
 Sets the shading layer.
 
ModuleMaterialget_override_material () const
 Returns the override material. May be null if none is set.
 
void set_override_material (ModuleMaterial *m)
 Sets the override material. Parameter may be null.
 
const ModuleRendererget_renderer () const
 
virtual double get_pixel_aspect_ratio () const
 Returns the pixel aspect ratio.
 
- Public Member Functions inherited from ModuleLayer
virtual void destroy_all ()
 
unsigned int get_width () const
 Returns the width of the layer.
 
unsigned int get_height () const
 Returns the height of the layer.
 
ModuleImageget_parent_image () const
 Returns the ModuleImage containing the layer.
 
const double & get_opacity () const
 Returns the opacity of the layer.
 
const int & get_blending_mode () const
 Returns the blending mode of the layer.
 
bool is_active () const
 Returns whether the current layer is active or not. Inactive layers are not composited in the final image.
 
virtual ImageHandle get_image (const ModuleImageQuality::Level &quality, const GMathVec4f *region=0) const
 Returns a handle to the image for the specified quality. If the image is not already available, a render is started. The function returns only when the render is finished.
 
virtual bool is_image_dirty (const ModuleImageQuality::Level &quality, const bool &strict=false) const
 Checks if the specified quality has already been computed.
 
const ImageCanvaspeek_source_image (const ModuleImageQuality::Level &quality) const
 Just returns a handle to the current image; does not launch evaluation.
 
bool add_image_level_update_callback (void *data, ModuleImageLevelUpdateCallback on_image_level_update)
 This function registers a new "image level update" callback item. The callback function is called every time a new render is finished (for each quality).
 
void remove_image_level_update_callback (void *data)
 Removes an image level updated receiver.
 
unsigned int get_image_level_update_receivers_count () const
 Removes an image level updated receiver.
 
void start_progress (const ModuleImageQuality::Level &quality)
 Starts the mechanism allowing the display of a progress image.
 
void stop_progress (ImageHandle *image)
 Stops the mechanism allowing the display of a progress image.
 
void update_region (const GMathVec4i &region, bool set_progress=true, float progress=-1.0f) const
 This function indicates that a new region of the image has been computed.
 
void bucket_render_start (const GMathVec4i &region, unsigned int thread_id)
 
 
void bucket_render_end (const GMathVec4i &region, unsigned int thread_id)
 
 
virtual void dirty_layer (const bool &dirty_source)
 Invalidate images, set dirtiness flags for all qualities.
 
virtual void mark_as_dirty ()
 Set the dirtiness flags of all the ImageCanvas stored in the layer.
 
void dirty_layer_border (GMathVec4f &region)
 Dirty all the tiles of the ImageCanvas that intersect the region.
 
void on_update_visible (const GMathBbox2f &old_region, const GMathBbox2f &new_region)
 Updates the image channels after the visible part of the region has been modified.
 
const bool & is_evaluating () const
 Returns true if a render is in progress.
 
ModuleImageQuality::Level get_nearest_quality (const unsigned int &w, const unsigned int h) const
 Returns the first quality for which the size of the image is greater than the parameters given.
If none is found, QUALITY_FULL is returned.
 
void image_level_update (const ModuleImageQuality::Level &quality) const
 Call the image level update callbacks for all registered requesters.
 
const int & get_render_region_mode () const
 Returns how render region is used: is it inherited from the parent image, or defined in the layer itself ?
 
const GMathVec4f & get_render_region_bbox () const
 Returns the values of the render region box.
 
GMathVec4i get_overscan (const ModuleImageQuality::Level &quality) const
 Returns the overscan, in pixel for the current render.
 
GMathVec4f get_overscan () const
 Returns the overscan values (ratio).
 
GMathVec4i get_data_window (const ModuleImageQuality::Level &quality) const
 Returns the data region [ x0, y0, w, h].
 
bool update_overscan ()
 Updates the overscan variables from the object attribute values.
 
ImageHandleget_pyramid_source_image (const ModuleImageQuality::Level &quality) const
 Returns the ImageCanvas stored in the source pyramid for the specified quality.
 
void resize_image (const ImageCanvas &source, ImageCanvas &dest, const ModuleImageQuality::Level &quality, const int &width, const int &height, const GMathVec4f *render_region) const
 Resize an image.
 
char * get_progress_buffer () const
 Returns the pointer to the buffer that will be used to retrive recently computed pixels.
 
void init_progress_buffer (const int &quality)
 
void update_progress (ModuleImage &image, const EventInfo &event, void *data)
 
ImageHandleget_highest_quality_image () const
 Returns the pointer to the best image quality that has been computed. Used to initialize the progress image.
 
virtual size_t get_memory_size () const override
 Returns the memory used by the current instance.
 
void set_finalize_image (bool _finalize_image=true)
 
bool get_finalize_image () const
 
ModuleImageFilteradd_filter (const CoreString &class_name, const CoreString &filter_name)
 Adds a new filter.
 
bool has_active_filters () const
 
int get_progress_pixel_count () const
 For internal use.
 
int get_progress_pixel_count_max () const
 For internal use.
 
float get_progress_pixel_percent () const
 For internal use.
 
void set_progress_pixel_count (int count)
 For internal use.
 

Protected Types

enum  RendererFilterMode {
  FILTER_MODE_GEOMETRIES = 0,
  FILTER_MODE_LIGHTS
}
 

Protected Member Functions

virtual void refresh_scene_objects_group ()
 
virtual void on_geometries_change (const OfAttr &attr, int &dirtiness, const int &dirtiness_flags)
 
void on_attribute_change (const OfAttr &attr, int &dirtiness, const int &dirtiness_flags) override
 
void set_scene_object_group (ModuleGroup *group)
 
void set_scene_objects_dirty ()
 
bool is_scene_objects_group_overridden () const
 
ModuleGroupget_internal_geometries_group (const CoreString &group_name, OfObject *source_group) const
 Get (and create) the internal group associated to the given group connected to a geometry attribute of the Layer Scene.
 
ModuleGroupget_internal_lights_group () const
 Get (and create) the internal group associated to the group connected to the "lights" attribute.
 
ModuleGroupget_context_objects_group () const
 Returns the internal group of geometries used by the Layer Scene when there is no group connected in the "geometries" attribute This group references all the scene objects in the context of the Layer Scene.
 
ModuleGroupget_embedded_group (const CoreString &group_name, RendererFilterMode mode, const bool &is_context_relative) const
 Return an embedded group created in the OfObject of the Layer Scene.
 
void apply_renderer_filters (ModuleGroup *group, RendererFilterMode mode) const
 Update the class filters of group with the class filters of the renderer.
 
- Protected Member Functions inherited from ModuleLayer
virtual const ImageCanvasget_source_image (const ModuleImageQuality::Level &quality, const GMathVec4f *region=0) const
 
virtual ImageHandlecreate_pyramid_image (const ModuleImageQuality::Level &quality) const
 
virtual void update_channels (const ModuleImageQuality::Level &quality) const
 
virtual void module_constructor (OfObject &object) override
 
void build_image (const ModuleImageQuality::Level &quality, const GMathVec4f *region=0) const
 
void dirty_image_channels (const CoreVector< CoreString > &channel_names)
 
void update_image_channels (const CoreVector< CoreString > &remove_channels, const CoreVector< CoreString > &add_channels)
 
void dirty_layer_position ()
 
void image_level_update (const ModuleImageQuality::Level &quality, ImageHandle image) const
 

Additional Inherited Members

- Public Types inherited from EventObject
typedef void(* EventInfoFunction )(EventObject &, const EventInfo &, void *)
 event callback signature for free functions / static methods.
 
typedef void(EventObject::* EventInfoMethod )(EventObject &, const EventInfo &, void *)
 event callback signature for methods.
 
typedef void(* EventFunction )(EventObject &, const CoreString &, void *)
 
typedef void(EventObject::* EventMethod )(EventObject &, const CoreString &, void *)
 
- Static Public Member Functions inherited from ModuleObject
static ResourceID declare_resource (const char *tag)
 
static ResourceID declare_resource (const CoreString &tag)
 
static bool declare_resource (ResourceID id, const char *tag)
 
static bool declare_resource (ResourceID id, const CoreString &tag)
 
static ResourceID get_resource_id (const char *tag)
 
static ResourceID get_resource_id (const CoreString &tag)
 
static const char * get_resource_tag (ResourceID id)
 
static void clear_unused_resources (SysThreadManager &thread_manager, const CoreBasicArray< OfObject * > &objects)
 
- Static Public Attributes inherited from ModuleObject
static constexpr unsigned int null_variation = 0
 Key of the null resource variation.
 

Member Function Documentation

void ModuleLayerScene::apply_renderer_filters ( ModuleGroup group,
RendererFilterMode  mode 
) const
protected

Update the class filters of group with the class filters of the renderer.

Parameters
groupOne of the internal groups of the Layer Scene on which to apply the renderer filters
modeSpecify if we want to apply the geometry filters or the light filters of the renderer
See Also
ModuleRenderer::get_supported_geometries() and ModuleRenderer::get_supported_lights()
ModuleGroup * ModuleLayerScene::get_embedded_group ( const CoreString group_name,
RendererFilterMode  mode,
const bool &  is_context_relative 
) const
protected

Return an embedded group created in the OfObject of the Layer Scene.

Parameters
group_nameName of the embedded group
modeDo we have to apply the geometry filters or the light filters of the renderer to the group ?
is_context_relativeDoes the group have to include all objects inside the context of the Layer Scene ? and we will just apply the filters of the renderer on it (see : ModuleGroup::force_update_referneces)
ModuleGroup * ModuleLayerScene::get_internal_geometries_group ( const CoreString group_name,
OfObject source_group 
) const
protected

Get (and create) the internal group associated to the given group connected to a geometry attribute of the Layer Scene.

Parameters
group_nameThe name of the internal group
source_groupThe group connected to an attribute of the 3D Layer ("geometries", "shadows", "raytracing", and "global_illumination" for example)
Note
The internal group will be used by the renderer, and used for dirtiness purposes. If source_group is null, it corresponds to a group referencing all the supported scene objects of the layer scene context, otherwise, it correspond to a group referencing the same scene objects as the group connected to the attribute, but with the renderer geometry filters applied
ModuleGroup * ModuleLayerScene::get_internal_lights_group ( ) const
protected

Get (and create) the internal group associated to the group connected to the "lights" attribute.

Note
The internal group will be used by the renderer, and used for dirtiness purposes. If no group is connected to the attribute, it corresponds to a group referencing all the supported lights of the layer scene context, otherwise, it correspond to a group referencing the same lights as the group connected to the attribute, but with the renderer light filters applied
void ModuleLayerScene::get_lights ( CoreArray< OfObjectHandle > &  lights,
const OfContext working_context = 0 
) const

Returns the list of lights as OfObjectHandle used by the layer scene.

Parameters
[in]working_contextContext in which the caller want to consider the objects
[out]lightsoutputs handles of objects in the given context
void ModuleLayerScene::get_scene_objects ( CoreArray< OfObjectHandle > &  objects,
const OfContext working_context = 0 
) const

Returns the list of objects as OfObjectHandle that are referenced by the layer scene.

Parameters
[in]working_contextContext in which the caller want to consider the objects
[out]objectsoutputs handles of objects in the given context
bool ModuleLayerScene::is_scene_objects_group_overridden ( ) const
protected

Returns true if m_scene_objects_group is overridden by a module inheriting from ModuleLayerScene It can be done by overriding the method ::refresh_scene_objects_group(). For example, 3D Layer overrides this group by a new internal group when there are matte objects