Rhino C++ API  8.13
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
ON_3dmRenderSettings Class Reference

#include <opennurbs_3dm_settings.h>

Inheritance diagram for ON_3dmRenderSettings:
ON_Object

Public Types

enum  EnvironmentPurpose : unsigned int { EnvironmentPurpose::Standard, EnvironmentPurpose::ForRendering }
 
enum  EnvironmentUsage : unsigned int { EnvironmentUsage::Background, EnvironmentUsage::Reflection, EnvironmentUsage::Skylighting }
 Access to information about which environments are used for rendering. More...
 
enum  RenderingSources : unsigned int { RenderingSources::ActiveViewport, RenderingSources::SpecificViewport, RenderingSources::NamedView, RenderingSources::SnapShot }
 
- Public Types inherited from ON_Object
enum  UserDataConflictResolution : unsigned char {
  UserDataConflictResolution::destination_object = 0, UserDataConflictResolution::source_object = 1, UserDataConflictResolution::source_copycount_gt = 2, UserDataConflictResolution::source_copycount_ge = 3,
  UserDataConflictResolution::destination_copycount_gt = 4, UserDataConflictResolution::destination_copycount_ge = 5, UserDataConflictResolution::delete_item = 6
}
 

Public Member Functions

 ON_3dmRenderSettings ()=default
 
 ON_3dmRenderSettings (const ON_3dmRenderSettings &)
 
virtual ~ON_3dmRenderSettings ()
 
class ON_DitheringDithering (void)
 Access to Dithering information. More...
 
const ON_DitheringDithering (void) const
 
void Dump (ON_TextLog &text_log) const override
 
class ON_GroundPlaneGroundPlane (void)
 Access to Ground Plane information. More...
 
const ON_GroundPlaneGroundPlane (void) const
 
void InvalidateCaches (void) const
 Invalidate any caches in the render settings. More...
 
class ON_LinearWorkflowLinearWorkflow (void)
 Access to Linear Workflow information. More...
 
const ON_LinearWorkflowLinearWorkflow (void) const
 
ON_wString NamedView (void) const
 
ON_3dmRenderSettingsoperator= (const ON_3dmRenderSettings &)
 
class ON_PostEffectsPostEffects (void)
 Access to Post Effect information. More...
 
const ON_PostEffectsPostEffects (void) const
 
bool Read (ON_BinaryArchive &) override
 
class ON_RenderChannelsRenderChannels (void)
 Access to Render Channels information. More...
 
const ON_RenderChannelsRenderChannels (void) const
 
ON_UUID RenderEnvironmentId (EnvironmentUsage usage, EnvironmentPurpose purpose) const
 
bool RenderEnvironmentOverride (EnvironmentUsage usage) const
 
RenderingSources RenderingSource (void) const
 
class ON_SafeFrameSafeFrame (void)
 Access to Safe Frame information. More...
 
const ON_SafeFrameSafeFrame (void) const
 
bool ScaleBackgroundToFit () const
 
void SetNamedView (const ON_wString &)
 
void SetRenderEnvironmentId (EnvironmentUsage usage, const ON_UUID &id)
 Sets the id of the rendering environment for a particular usage. More...
 
void SetRenderEnvironmentOverride (EnvironmentUsage usage, bool on)
 
void SetRenderingSource (RenderingSources)
 
void SetScaleBackgroundToFit (bool bScaleBackgroundToFit)
 
void SetSnapshot (const ON_wString &)
 
void SetSpecificViewport (const ON_wString &)
 
class ON_SkylightSkylight (void)
 Access to Skylight information. More...
 
const ON_SkylightSkylight (void) const
 
ON_wString Snapshot (void) const
 
ON_wString SpecificViewport (void) const
 
class ON_SunSun (void)
 Access to Sun information. More...
 
const ON_SunSun (void) const
 
bool Write (ON_BinaryArchive &) const override
 
- Public Member Functions inherited from ON_Object
 ON_Object () ON_NOEXCEPT
 
 ON_Object (const ON_Object &)
 
virtual ~ON_Object ()
 
virtual ON_AggregateComponentStatus AggregateComponentStatus () const
 
bool AttachUserData (class ON_UserData *pUserData)
 
unsigned int ClearAllComponentStates () const
 
virtual unsigned int ClearComponentStates (ON_COMPONENT_INDEX component_index, ON_ComponentStatus states_to_clear) const
 
virtual unsigned int ClearComponentStates (ON_ComponentStatus states_to_clear) const
 
void CopyUserData (const ON_Object &source_object)
 
unsigned int CopyUserData (const ON_Object &source_object, ON_UUID source_userdata_item_id, ON_Object::UserDataConflictResolution userdata_conflict_resolution)
 
virtual ON__UINT32 DataCRC (ON__UINT32 current_remainder) const
 
virtual bool DeleteComponents (const ON_COMPONENT_INDEX *ci_list, size_t ci_count)
 
virtual void DestroyRuntimeCache (bool bDelete=true)
 
bool DetachUserData (class ON_UserData *pUserData)
 
void EmergencyDestroy ()
 
class ON_UserDataFirstUserData () const
 
virtual unsigned int GetComponentsWithSetStates (ON_ComponentStatus states_filter, bool bAllEqualStates, ON_SimpleArray< ON_COMPONENT_INDEX > &components) const
 
class ON_UserDataGetUserData (const ON_UUID &userdata_uuid) const
 
bool GetUserString (const wchar_t *key, ON_wString &string_value) const
 
int GetUserStringKeys (ON_ClassArray< ON_wString > &user_string_keys) const
 
int GetUserStrings (ON_ClassArray< ON_UserString > &user_strings) const
 
bool IsCorrupt (bool bRepair, bool bSilentError, class ON_TextLog *text_log) const
 
bool IsKindOf (const ON_ClassId *pClassId) const
 
virtual bool IsValid (class ON_TextLog *text_log=nullptr) const
 
virtual void MarkAggregateComponentStatusAsNotCurrent () const
 
virtual void MemoryRelocate ()
 
virtual ON_UUID ModelObjectId () const
 
void MoveUserData (ON_Object &source_object)
 
unsigned int MoveUserData (ON_Object &source_object, ON_UUID source_userdata_item_id, ON_Object::UserDataConflictResolution userdata_conflict_resolution, bool bDeleteAllSourceItems)
 
virtual ON::object_type ObjectType () const
 
ON_Objectoperator= (const ON_Object &)
 
void PurgeUserData ()
 
virtual unsigned int SetComponentStates (ON_COMPONENT_INDEX component_index, ON_ComponentStatus states_to_set) const
 
virtual unsigned int SetComponentStatus (ON_COMPONENT_INDEX component_index, ON_ComponentStatus status_to_copy) const
 
bool SetUserString (const wchar_t *key, const wchar_t *string_value)
 
int SetUserStrings (int count, const ON_UserString *user_strings, bool bReplace)
 
virtual unsigned int SizeOf () const
 
bool ThisIsNullptr (bool bSilentError) const
 
void TransformUserData (const class ON_Xform &xform)
 
virtual bool UpdateReferencedComponents (const class ON_ComponentManifest &source_manifest, const class ON_ComponentManifest &destination_manifest, const class ON_ManifestMap &manifest_map)
 
int UserStringCount () const
 

Public Attributes

ON_Color m_ambient_light = ON_Color::Black
 
int m_antialias_style = 1
 0 = none, 1 = normal, 2 = medium, 3 = best More...
 
ON_wString m_background_bitmap_filename
 
ON_Color m_background_bottom_color = ON_Color::Gray160
 
ON_Color m_background_color = ON_Color::White
 
int m_background_style = 0
 0 = solid color, 1 = "wallpaper" image, 2 = Gradient, 3 = Environment More...
 
bool m_bCustomImageSize = false
 
bool m_bDepthCue = false
 
bool m_bFlatShade = false
 
bool m_bForceViewportAspectRatio = false
 
bool m_bRenderAnnotation = false
 
bool m_bRenderBackfaces = true
 
bool m_bRenderCurves = false
 
bool m_bRenderIsoparams = false
 
bool m_bRenderMeshEdges = false
 
bool m_bRenderPoints = false
 
bool m_bScaleBackgroundToFit = false
 
bool m_bTransparentBackground = false
 
bool m_bUseHiddenLights = false
 
bool m_bUsesAmbientAttr = true
 
bool m_bUsesAnnotationAttr = true
 
bool m_bUsesBackfaceAttr = false
 
bool m_bUsesBackgroundAttr = true
 
bool m_bUsesCurvesAttr = true
 
bool m_bUsesHiddenLightsAttr = true
 
bool m_bUsesIsoparmsAttr = true
 
bool m_bUsesMeshEdgesAttr = false
 
bool m_bUsesPointsAttr = false
 
ON_UUID m_embedded_image_file_id = ON_nil_uuid
 
double m_image_dpi = 72.0
 
int m_image_height = 600
 image height in pixels More...
 
ON::LengthUnitSystem m_image_us = ON::LengthUnitSystem::Inches
 
int m_image_width = 800
 image width in pixels More...
 
int m_shadowmap_height = 1000
 
double m_shadowmap_offset = 0.75
 
int m_shadowmap_style = 1
 0 = none, 1 = normal, 2 = best More...
 
int m_shadowmap_width = 1000
 

Static Public Attributes

static const ON_3dmRenderSettings Default
 

Friends

class ON_3dmRenderSettingsPrivate
 
class ONX_ModelPrivate
 < For internal use only. More...
 

Detailed Description

ON_3dmRenderSettings

Member Enumeration Documentation

◆ EnvironmentPurpose

enum ON_3dmRenderSettings::EnvironmentPurpose : unsigned int
strong
Enumerator
Standard 

Used to directly get and set the environment instance id.

ForRendering 

Used to get the environment instance id to be used for actual rendering.

◆ EnvironmentUsage

enum ON_3dmRenderSettings::EnvironmentUsage : unsigned int
strong

Access to information about which environments are used for rendering.

Enumerator
Background 

Specifies the 360 background environment.

Reflection 

Specifies the custom reflective environment. Also used for refraction.

Skylighting 

Specifies the custom skylighting environment.

◆ RenderingSources

enum ON_3dmRenderSettings::RenderingSources : unsigned int
strong

New for V6, rendering source (render directly from a NamedView or Snapshot) https://mcneel.myjetbrains.com/youtrack/issue/RH-39593

Enumerator
ActiveViewport 

Get the rendering view from the currently active viewport (as in all previous versions of Rhino)

SpecificViewport 

Get the rendering view from the named viewport (see NamedViewport below)

NamedView 

Get the rendering view from a specific named view (see NamedView below)

SnapShot 

Before rendering, restore the Snapshot specified in Snapshot below, then render.

Constructor & Destructor Documentation

◆ ON_3dmRenderSettings() [1/2]

ON_3dmRenderSettings::ON_3dmRenderSettings ( )
default

◆ ~ON_3dmRenderSettings()

virtual ON_3dmRenderSettings::~ON_3dmRenderSettings ( )
virtual

◆ ON_3dmRenderSettings() [2/2]

ON_3dmRenderSettings::ON_3dmRenderSettings ( const ON_3dmRenderSettings )

Member Function Documentation

◆ Dithering() [1/2]

class ON_Dithering& ON_3dmRenderSettings::Dithering ( void  )

Access to Dithering information.

◆ Dithering() [2/2]

const ON_Dithering& ON_3dmRenderSettings::Dithering ( void  ) const

◆ Dump()

void ON_3dmRenderSettings::Dump ( ON_TextLog ) const
overridevirtual

Description: Creates a text dump of the object. Remarks: Dump() is intended for debugging and is not suitable for creating high quality text descriptions of an object.

The default implementations of this virtual function prints the class's name.

Reimplemented from ON_Object.

◆ GroundPlane() [1/2]

class ON_GroundPlane& ON_3dmRenderSettings::GroundPlane ( void  )

Access to Ground Plane information.

◆ GroundPlane() [2/2]

const ON_GroundPlane& ON_3dmRenderSettings::GroundPlane ( void  ) const

◆ InvalidateCaches()

void ON_3dmRenderSettings::InvalidateCaches ( void  ) const

Invalidate any caches in the render settings.

◆ LinearWorkflow() [1/2]

class ON_LinearWorkflow& ON_3dmRenderSettings::LinearWorkflow ( void  )

Access to Linear Workflow information.

◆ LinearWorkflow() [2/2]

const ON_LinearWorkflow& ON_3dmRenderSettings::LinearWorkflow ( void  ) const

◆ NamedView()

ON_wString ON_3dmRenderSettings::NamedView ( void  ) const

◆ operator=()

ON_3dmRenderSettings& ON_3dmRenderSettings::operator= ( const ON_3dmRenderSettings )

◆ PostEffects() [1/2]

class ON_PostEffects& ON_3dmRenderSettings::PostEffects ( void  )

Access to Post Effect information.

◆ PostEffects() [2/2]

const ON_PostEffects& ON_3dmRenderSettings::PostEffects ( void  ) const

◆ Read()

bool ON_3dmRenderSettings::Read ( ON_BinaryArchive binary_archive)
overridevirtual

Description: Low level archive writing tool used by ON_BinaryArchive::ReadObject(). Parameters: binary_archive - archive to read from Returns: Returns true if the read is successful. Remarks: Use ON_BinaryArchive::ReadObject() to read objects. This Read() function should read the objects definition back into its data members.

The default implementation of this virtual function returns false and does nothing.

Reimplemented from ON_Object.

◆ RenderChannels() [1/2]

class ON_RenderChannels& ON_3dmRenderSettings::RenderChannels ( void  )

Access to Render Channels information.

◆ RenderChannels() [2/2]

const ON_RenderChannels& ON_3dmRenderSettings::RenderChannels ( void  ) const

◆ RenderEnvironmentId()

ON_UUID ON_3dmRenderSettings::RenderEnvironmentId ( EnvironmentUsage  usage,
EnvironmentPurpose  purpose 
) const

Returns the id of the rendering environment for a particular usage. Param 'purpose' specifies the purpose the environment will be used for:

  • If purpose is Standard, this directly returns the id of the environment.
  • If purpose is ForRendering, this returns the id of the environment to be used during rendering. It includes all the logic for checking if the environment is enabled and available and for deferring to other environments if the requested usage is not available.

◆ RenderEnvironmentOverride()

bool ON_3dmRenderSettings::RenderEnvironmentOverride ( EnvironmentUsage  usage) const

Returns whether or not the rendering environment for a particular usage is overriding the background environment. Only really makes sense for usage Reflection and Skylighting, but for convenience, it also works for usage Background by checking if the background style is set to Environment.

◆ RenderingSource()

RenderingSources ON_3dmRenderSettings::RenderingSource ( void  ) const

◆ SafeFrame() [1/2]

class ON_SafeFrame& ON_3dmRenderSettings::SafeFrame ( void  )

Access to Safe Frame information.

◆ SafeFrame() [2/2]

const ON_SafeFrame& ON_3dmRenderSettings::SafeFrame ( void  ) const

◆ ScaleBackgroundToFit()

bool ON_3dmRenderSettings::ScaleBackgroundToFit ( ) const

◆ SetNamedView()

void ON_3dmRenderSettings::SetNamedView ( const ON_wString )

◆ SetRenderEnvironmentId()

void ON_3dmRenderSettings::SetRenderEnvironmentId ( EnvironmentUsage  usage,
const ON_UUID id 
)

Sets the id of the rendering environment for a particular usage.

◆ SetRenderEnvironmentOverride()

void ON_3dmRenderSettings::SetRenderEnvironmentOverride ( EnvironmentUsage  usage,
bool  on 
)

Sets whether or not the rendering environment for a particular usage is overriding the background environment. Only works for usage Reflection and Skylighting.

◆ SetRenderingSource()

void ON_3dmRenderSettings::SetRenderingSource ( RenderingSources  )

◆ SetScaleBackgroundToFit()

void ON_3dmRenderSettings::SetScaleBackgroundToFit ( bool  bScaleBackgroundToFit)

◆ SetSnapshot()

void ON_3dmRenderSettings::SetSnapshot ( const ON_wString )

◆ SetSpecificViewport()

void ON_3dmRenderSettings::SetSpecificViewport ( const ON_wString )

◆ Skylight() [1/2]

class ON_Skylight& ON_3dmRenderSettings::Skylight ( void  )

Access to Skylight information.

◆ Skylight() [2/2]

const ON_Skylight& ON_3dmRenderSettings::Skylight ( void  ) const

◆ Snapshot()

ON_wString ON_3dmRenderSettings::Snapshot ( void  ) const

◆ SpecificViewport()

ON_wString ON_3dmRenderSettings::SpecificViewport ( void  ) const

◆ Sun() [1/2]

class ON_Sun& ON_3dmRenderSettings::Sun ( void  )

Access to Sun information.

◆ Sun() [2/2]

const ON_Sun& ON_3dmRenderSettings::Sun ( void  ) const

◆ Write()

bool ON_3dmRenderSettings::Write ( ON_BinaryArchive binary_archive) const
overridevirtual

Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

The default implementation of this virtual function returns false and does nothing.

Reimplemented from ON_Object.

Friends And Related Function Documentation

◆ ON_3dmRenderSettingsPrivate

friend class ON_3dmRenderSettingsPrivate
friend

◆ ONX_ModelPrivate

friend class ONX_ModelPrivate
friend

< For internal use only.

Member Data Documentation

◆ Default

const ON_3dmRenderSettings ON_3dmRenderSettings::Default
static

◆ m_ambient_light

ON_Color ON_3dmRenderSettings::m_ambient_light = ON_Color::Black

◆ m_antialias_style

int ON_3dmRenderSettings::m_antialias_style = 1

0 = none, 1 = normal, 2 = medium, 3 = best

◆ m_background_bitmap_filename

ON_wString ON_3dmRenderSettings::m_background_bitmap_filename

◆ m_background_bottom_color

ON_Color ON_3dmRenderSettings::m_background_bottom_color = ON_Color::Gray160

◆ m_background_color

ON_Color ON_3dmRenderSettings::m_background_color = ON_Color::White

m_background_color was changed from ON_Color::Gray160 to ON_Color::White for "white studio" look. m_background_color = Top color of gradient...

◆ m_background_style

int ON_3dmRenderSettings::m_background_style = 0

0 = solid color, 1 = "wallpaper" image, 2 = Gradient, 3 = Environment

◆ m_bCustomImageSize

bool ON_3dmRenderSettings::m_bCustomImageSize = false

Custom image size: If m_bCustomImageSize is true, then the image pixel size is m_image_width X m_image_height pixels. If m_bCustomImageSize is false, then the image pixel size is the size of the viewport being rendered.

◆ m_bDepthCue

bool ON_3dmRenderSettings::m_bDepthCue = false

◆ m_bFlatShade

bool ON_3dmRenderSettings::m_bFlatShade = false

◆ m_bForceViewportAspectRatio

bool ON_3dmRenderSettings::m_bForceViewportAspectRatio = false

Force viewport aspect ratio: If m_bCustomImageSize is true and m_bForceViewportAspectRatio is true then the image height should be calculated by multiplying the m_image_width by the viewport aspect ratio. Note that this might be affected by m_rendering_source In this case, m_image_height should not be used.

◆ m_bRenderAnnotation

bool ON_3dmRenderSettings::m_bRenderAnnotation = false

◆ m_bRenderBackfaces

bool ON_3dmRenderSettings::m_bRenderBackfaces = true

◆ m_bRenderCurves

bool ON_3dmRenderSettings::m_bRenderCurves = false

◆ m_bRenderIsoparams

bool ON_3dmRenderSettings::m_bRenderIsoparams = false

◆ m_bRenderMeshEdges

bool ON_3dmRenderSettings::m_bRenderMeshEdges = false

◆ m_bRenderPoints

bool ON_3dmRenderSettings::m_bRenderPoints = false

◆ m_bScaleBackgroundToFit

bool ON_3dmRenderSettings::m_bScaleBackgroundToFit = false

◆ m_bTransparentBackground

bool ON_3dmRenderSettings::m_bTransparentBackground = false

◆ m_bUseHiddenLights

bool ON_3dmRenderSettings::m_bUseHiddenLights = false

◆ m_bUsesAmbientAttr

bool ON_3dmRenderSettings::m_bUsesAmbientAttr = true

Flags that are used to determine which render settings a render plugin uses, and which ones the display pipeline should use. Note: Render plugins set these, and they don't need to persist in the document...Also, when set, they turn OFF their corresponding setting in the Display Attributes Manager's UI pages for "Rendered" mode.

◆ m_bUsesAnnotationAttr

bool ON_3dmRenderSettings::m_bUsesAnnotationAttr = true

◆ m_bUsesBackfaceAttr

bool ON_3dmRenderSettings::m_bUsesBackfaceAttr = false

◆ m_bUsesBackgroundAttr

bool ON_3dmRenderSettings::m_bUsesBackgroundAttr = true

◆ m_bUsesCurvesAttr

bool ON_3dmRenderSettings::m_bUsesCurvesAttr = true

◆ m_bUsesHiddenLightsAttr

bool ON_3dmRenderSettings::m_bUsesHiddenLightsAttr = true

◆ m_bUsesIsoparmsAttr

bool ON_3dmRenderSettings::m_bUsesIsoparmsAttr = true

◆ m_bUsesMeshEdgesAttr

bool ON_3dmRenderSettings::m_bUsesMeshEdgesAttr = false

◆ m_bUsesPointsAttr

bool ON_3dmRenderSettings::m_bUsesPointsAttr = false

◆ m_embedded_image_file_id

ON_UUID ON_3dmRenderSettings::m_embedded_image_file_id = ON_nil_uuid

If m_background_bitmap_filename is not empty, the file cannot be found, and m_embedded_file_id identifies an embedded image file in the model, then that file will be used as the background bitmap.

◆ m_image_dpi

double ON_3dmRenderSettings::m_image_dpi = 72.0

Number of dots/inch (dots=pixels) to use when printing and saving bitmaps. The default is 72.0 dots/inch.

◆ m_image_height

int ON_3dmRenderSettings::m_image_height = 600

image height in pixels

◆ m_image_us

ON::LengthUnitSystem ON_3dmRenderSettings::m_image_us = ON::LengthUnitSystem::Inches

unit system to use when converting image pixel size and dpi information into a print size. Default = inches

◆ m_image_width

int ON_3dmRenderSettings::m_image_width = 800

image width in pixels

◆ m_shadowmap_height

int ON_3dmRenderSettings::m_shadowmap_height = 1000

◆ m_shadowmap_offset

double ON_3dmRenderSettings::m_shadowmap_offset = 0.75

◆ m_shadowmap_style

int ON_3dmRenderSettings::m_shadowmap_style = 1

0 = none, 1 = normal, 2 = best

◆ m_shadowmap_width

int ON_3dmRenderSettings::m_shadowmap_width = 1000