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

#include <opennurbs_layer.h>

Inheritance diagram for ON_Layer:
ON_ModelComponent ON_Object CRhinoLayer

Public Types

enum  PER_VIEWPORT_SETTINGS : unsigned int {
  per_viewport_none = 0, per_viewport_id = 1, per_viewport_color = 2, per_viewport_plot_color = 4,
  per_viewport_plot_weight = 8, per_viewport_visible = 16, per_viewport_persistent_visibility = 32, per_viewport_all_settings = 0xFFFFFFFF
}
 
- Public Types inherited from ON_ModelComponent
enum  Attributes : unsigned int {
  NoAttributes = 0U, ComponentSerialNumberAttribute = 0x0001U, TypeAttribute = 0x0002U, ModelSerialNumberAttribute = 0x0004U,
  IdAttribute = 0x0008U, IndexAttribute = 0x0010U, NameAttribute = 0x0020U, ParentIdAttribute = 0x0040U,
  DeletedNameAttribute = 0x0080U, ComponentStatusAttribute = 0x0100U, BinaryArchiveAttributes = 0x78U, AllAttributes = 0x1FFU,
  SystemComponentAttribute = 0x8000U
}
 
enum  Type : unsigned char {
  Type::Unset = 0, Type::Image = 1, Type::TextureMapping = 2, Type::Material = 3,
  Type::RenderMaterial = Material, Type::LinePattern = 4, Type::Layer = 5, Type::Group = 6,
  Type::TextStyle = 7, Type::DimStyle = 8, Type::RenderLight = 9, Type::HatchPattern = 10,
  Type::InstanceDefinition = 11, Type::ModelGeometry = 12, Type::HistoryRecord = 13, Type::RenderContent = 14,
  Type::EmbeddedFile = 15, Type::ObsoleteValue = 16, Type::SectionStyle = 17, Type::NumOf,
  Type::Mixed = 0xFE
}
 The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
 
- 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_Layer () ON_NOEXCEPT
 
 ON_Layer (const ON_Layer &)
 
 ~ON_Layer ()
 
ON_Color Color () const
 
bool CopyPerViewportSettings (const ON_Layer &source_layer, ON_UUID viewport_id, unsigned int settings_mask)
 
bool CopyPerViewportSettings (ON_UUID source_viewport_id, ON_UUID destination_viewport_id)
 
void CullPerViewportSettings (int viewport_id_count, const ON_UUID *viewport_id_list)
 
const ON_SectionStyleCustomSectionStyle (ON_SectionStyle *sectionStyle=nullptr) const
 
void DeleteModelVisible ()
 
void DeletePerViewportColor (const ON_UUID &viewport_id)
 
void DeletePerViewportPlotColor (const ON_UUID &viewport_id)
 
void DeletePerViewportPlotWeight (const ON_UUID &viewport_id)
 
void DeletePerViewportSettings (const ON_UUID &viewport_id) const
 
void DeletePerViewportVisible (const ON_UUID &viewport_id)
 
void Dump (ON_TextLog &) const override
 for debugging More...
 
void GetPerViewportVisibilityViewportIds (ON_SimpleArray< ON_UUID > &viewport_id_list) const
 
bool HasPerViewportSettings (const ON_UUID &viewport_id) const
 
bool HasPerViewportSettings (ON_UUID viewport_id, unsigned int settings_mask) const
 
int IgesLevel () const
 
bool IsValid (class ON_TextLog *text_log=nullptr) const override
 
bool IsVisible () const
 
bool IsVisible (const class ON_3dmView *view) const
 
bool IsVisibleAndLocked () const
 
bool IsVisibleAndNotLocked () const
 
int LinetypeIndex () const
 
bool ModelIsVisible () const
 
bool ModelPersistentVisibility () const
 
ON::object_type ObjectType () const override
 
ON_Layeroperator= (const ON_Layer &)
 
ON_UUID ParentLayerId () const
 
bool PersistentLocking () const
 
bool PersistentVisibility () const
 
ON_Color PerViewportColor (ON_UUID viewport_id) const
 
bool PerViewportIsVisible (ON_UUID viewport_id) const
 
bool PerViewportIsVisibleInNewDetails () const
 
bool PerViewportPersistentVisibility (ON_UUID viewport_id) const
 
ON_Color PerViewportPlotColor (ON_UUID viewport_id) const
 
double PerViewportPlotWeight (ON_UUID viewport_id) const
 
ON__UINT32 PerViewportSettingsCRC () const
 
ON_Color PlotColor () const
 
double PlotWeight () const
 
bool Read (ON_BinaryArchive &) override
 
void RemoveCustomSectionStyle ()
 
int RenderMaterialIndex () const
 
void SetColor (ON_Color layer_color)
 layer display color More...
 
void SetCustomSectionStyle (const ON_SectionStyle &sectionStyle)
 
bool SetIgesLevel (int)
 IGES level for this layer. More...
 
bool SetLinetypeIndex (int linetype_index)
 
void SetLocked (bool bLocked)
 
void SetModelPersistentVisibility (bool bPersistentVisibility)
 
void SetModelVisible (bool bVisible)
 
void SetParentLayerId (ON_UUID parent_layer_id)
 
void SetPersistentLocking (bool bPersistentLocking)
 
void SetPersistentVisibility (bool bPersistentVisibility)
 
void SetPerViewportColor (ON_UUID viewport_id, ON_Color layer_color)
 
void SetPerViewportIsVisibleInNewDetails (bool bVisible)
 
void SetPerViewportPersistentVisibility (ON_UUID viewport_id, bool bPersistentVisibility)
 
void SetPerViewportPlotColor (ON_UUID viewport_id, ON_Color plot_color)
 
void SetPerViewportPlotWeight (ON_UUID viewport_id, double plot_weight_mm)
 
void SetPerViewportVisible (ON_UUID viewport_id, bool bVisible)
 
void SetPlotColor (ON_Color plot_color)
 plotting color More...
 
void SetPlotWeight (double plot_weight_mm)
 
bool SetRenderMaterialIndex (int)
 index of layer's rendering material More...
 
void SetVisible (bool bVisible)
 
void UnsetModelPersistentVisibility ()
 
void UnsetPersistentLocking ()
 
void UnsetPersistentVisibility ()
 
void UnsetPerViewportPersistentVisibility (ON_UUID viewport_id)
 
bool UpdateReferencedComponents (const class ON_ComponentManifest &source_manifest, const class ON_ComponentManifest &destination_manifest, const class ON_ManifestMap &manifest_map) override
 
int UpdateViewportIds (const ON_UuidPairList &viewport_id_map)
 
bool Write (ON_BinaryArchive &) const override
 
- Public Member Functions inherited from ON_ModelComponent
 ON_ModelComponent () ON_NOEXCEPT
 
 ON_ModelComponent (const ON_ModelComponent &source)
 
 ON_ModelComponent (ON_ModelComponent::Type component_type) ON_NOEXCEPT
 
 ON_ModelComponent (ON_ModelComponent::Type component_type, const ON_ModelComponent &source) ON_NOEXCEPT
 Locked status of source attributes is not copied to permit copy and modify operations. More...
 
 ~ON_ModelComponent ()=default
 
bool ChangeName (const wchar_t *new_name, class ON_ComponentManifest *manifest)
 
bool ClearComponentType ()
 
bool ClearId ()
 
bool ClearIndex ()
 
unsigned int ClearModelComponentAttributes (unsigned int attributes_filter)
 
bool ClearModelComponentStatus ()
 
bool ClearModelSerialNumber ()
 
bool ClearName ()
 
bool ClearParentId ()
 
int CompareName (const ON_UUID &other_parent_id, const wchar_t *other_name) const
 
int CompareName (const wchar_t *other_name) const
 
int CompareNameExact (const ON_UUID &other_parent_id, const wchar_t *other_name) const
 
int CompareNameExact (const wchar_t *other_name) const
 
ON_ModelComponent::Type ComponentType () const
 
bool ComponentTypeIsLocked () const
 
bool ComponentTypeIsSet () const
 
ON__UINT64 ContentVersionNumber () const
 
unsigned int CopyFrom (const ON_ModelComponent &src, unsigned int attributes_filter)
 
ON__UINT32 DataCRC (ON__UINT32 current_remainder) const override
 
const ON_wString DeletedName () const
 
const ON_NameHashDeletedNameHash () const
 
bool DeletedNameIsSet () const
 
bool DeleteName ()
 
void Dump (ON_TextLog &) const override
 
bool EraseIdentification (bool bIgnoreLocks)
 
const wchar_tGetName (ON_wString &component_name) const
 
const ON_UUIDId () const
 
bool IdIsLocked () const
 
bool IdIsNil () const
 
bool IdIsNotNil () const
 
bool IdIsSet () const
 
const ON_UUIDIfIdIsNilSetId ()
 
int Index () const
 
int Index (int unset_index_value) const
 
bool IndexIsLocked () const
 
bool IndexIsSet () const
 
unsigned int InstanceDefinitionModelSerialNumber () const
 
bool IsDeleted () const
 
bool IsHidden () const
 
bool IsLocked () const
 
bool IsReferenceComponent () const
 
bool IsSystemComponent () const
 
bool IsValid (class ON_TextLog *text_log=nullptr) const override
 
void LockAllSettingsExceptName ()
 
void LockComponentType ()
 
void LockId ()
 
void LockIndex ()
 
void LockModelComponentStatus ()
 
void LockModelSerialNumber ()
 
void LockName ()
 
void LockParentId ()
 
ON_ComponentStatus ModelComponentStatus () const
 
bool ModelComponentStatusIsLocked () const
 
bool ModelComponentStatusIsSet () const
 
ON_UUID ModelObjectId () const override
 
unsigned int ModelSerialNumber () const
 
bool ModelSerialNumberIsLocked () const
 
bool ModelSerialNumberIsSet () const
 
const ON_wString Name () const
 
const wchar_tNameAsPointer () const
 
const ON_NameHashNameHash () const
 
bool NameIsEmpty () const
 
bool NameIsLocked () const
 
bool NameIsNotEmpty () const
 
bool NameIsSet () const
 
const ON_NameHash NewNameHash (const wchar_t *new_name) const
 
ON_ModelComponentoperator= (const ON_ModelComponent &source)
 
const ON_UUIDParentId () const
 
bool ParentIdIsLocked () const
 
bool ParentIdIsNil () const
 
bool ParentIdIsNotNil () const
 
bool ParentIdIsSet () const
 
bool ReadModelComponentAttributes (class ON_BinaryArchive &archive)
 
unsigned int ReferenceModelSerialNumber () const
 
ON__UINT64 RuntimeSerialNumber () const
 
const ON_UUIDSetAndLockId ()
 
bool SetAsSystemComponent ()
 
bool SetAsUnsetSystemComponent ()
 
bool SetComponentType (ON_ModelComponent::Type component_component_type)
 
bool SetDeletedModelComponentState (bool bDeleted, class ON_ComponentManifest *manifest)
 
void SetHiddenModelComponentState (bool bHidden)
 
const ON_UUIDSetId ()
 
bool SetId (const ON_UUID &component_id)
 
bool SetIdentification (const class ON_ComponentManifestItem &manifest_item, const wchar_t *manifest_name, bool bSetId, bool bParentId, bool bSetName, bool bSetIndex)
 
bool SetIndex (int component_index)
 
bool SetLocalizedSystemComponentName (const wchar_t *system_component_localized_name)
 
void SetLockedModelComponentState (bool bLocked)
 
bool SetModelComponentStatus (ON_ComponentStatus component_status)
 
bool SetModelSerialNumber (unsigned int model_serial_number)
 
bool SetModelSerialNumber (unsigned int model_serial_number, unsigned int reference_model_serial_number, unsigned int instance_definition_model_serial_number)
 
bool SetName (const wchar_t *component_name)
 
bool SetParentId (const ON_UUID &parent_id)
 
unsigned int SizeOf () const override
 
bool UndeleteName ()
 
bool WriteModelComponentAttributes (class ON_BinaryArchive &archive, unsigned int attributes_filter) const
 
- 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 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 void MarkAggregateComponentStatusAsNotCurrent () const
 
virtual void MemoryRelocate ()
 
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)
 
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)
 
bool ThisIsNullptr (bool bSilentError) const
 
void TransformUserData (const class ON_Xform &xform)
 
int UserStringCount () const
 

Static Public Member Functions

static const ON_LayerFromModelComponentRef (const class ON_ModelComponentReference &model_component_reference, const ON_Layer *none_return_value)
 
- Static Public Member Functions inherited from ON_ModelComponent
static int CompareId (const ON_ModelComponent &a, const ON_ModelComponent &b)
 
static int CompareIdAndName (const ON_ModelComponent &a, const ON_ModelComponent &b)
 
static int CompareName (const ON_ModelComponent &a, const ON_ModelComponent &b)
 
static int CompareNameAndId (const ON_ModelComponent &a, const ON_ModelComponent &b)
 
static int CompareNameExact (const ON_ModelComponent &a, const ON_ModelComponent &b)
 
static ON_ModelComponent::Type ComponentTypeFromUnsigned (unsigned int component_type_as_unsigned)
 
static bool ComponentTypeIsValid (ON_ModelComponent::Type component_type)
 
static bool ComponentTypeIsValidAndNotMixed (ON_ModelComponent::Type component_type)
 
static const ON_wString ComponentTypeToString (ON_ModelComponent::Type)
 
static bool IndexRequired (ON_ModelComponent::Type component_type)
 
static unsigned int Internal_SystemComponentHelper ()
 For internal use. Never call this function. More...
 
static const wchar_tIsNamePathSeparator (const wchar_t *s)
 
*static const wchar_tIsReferencePrefixDelimiter (const wchar_t *s)
 
static const wchar_tIsReferencePrefixSeparator (const wchar_t *s)
 
static bool IsValidComponentName (const class ON_ComponentManifest &model_manfest, const ON_ModelComponent &model_component, bool bPermitReferencePrefix, ON_wString &valid_name)
 
static bool IsValidComponentName (const ON_wString &candidate_component_name)
 
static bool IsValidComponentName (const wchar_t *candidate_component_name)
 
static bool IsValidComponentName (size_t length, const wchar_t *candidate_component_name)
 
static bool IsValidComponentNameFirstCodePoint (int length, const wchar_t *candidate_component_name)
 
static bool IsValidComponentNameFirstCodePoint (ON__UINT32 unicode_code_point)
 
static const ON_wString NameLeaf (const wchar_t *name)
 
static const ON_wString NameParent (const wchar_t *name, bool bIncludeReference)
 
static const ON_wString NameReferencePrefix (const wchar_t *name)
 
static ON__UINT64 NextRuntimeSerialNumber ()
 
static const ON_wString RemoveAllReferencePrefixDelimiters (const wchar_t *name)
 
static const ON_wString RemoveReferencePrefix (const wchar_t *name)
 
static const ON_wString RemoveTrailingNamePathSeparator (const wchar_t *name)
 
static const ON_wString RemoveTrailingReferencePrefixDelimiter (const wchar_t *name)
 
static const ON_wString RemoveTrailingReferencePrefixSeparator (const wchar_t *name)
 
static void SplitName (const wchar_t *name, ON_wString &reference_prefix, ON_wString &name_parent, ON_wString &name_leaf)
 
static bool UniqueNameIgnoresCase (ON_ModelComponent::Type component_type)
 
static bool UniqueNameIncludesParent (ON_ModelComponent::Type component_type)
 
static bool UniqueNameRequired (ON_ModelComponent::Type component_type)
 

Public Attributes

bool m_bExpanded = true
 
ON_Color m_color = ON_Color::Black
 
ON_UUID m_display_material_id = ON_nil_uuid
 
int m_iges_level = -1
 IGES level number if this layer was made during IGES import. More...
 
int m_linetype_index = -1
 index of linetype More...
 
int m_material_index = -1
 
ON_Color m_plot_color = ON_Color::UnsetColor
 Layer printing (plotting) attributes. More...
 
double m_plot_weight_mm = 0.0
 ON_UNSET_COLOR means use layer color. More...
 
ON_RenderingAttributes m_rendering_attributes
 

Static Public Attributes

static const ON_Layer Default
 index = -1, id set, unique and persistent More...
 
static const ON_Layer Unset
 index = ON_UNSET_INT_INDEX, id = nil More...
 
- Static Public Attributes inherited from ON_ModelComponent
static const ON_wString NamePathSeparator
 
static const ON_wString ReferencePrefixDelimiter
 
static const ON_wString ReferencePrefixSeparator
 
static const ON_ModelComponent Unset
 
*static const ON_wString WorksessionReferencePrefix *const wchar_t
 

Additional Inherited Members

- Protected Member Functions inherited from ON_ModelComponent
void IncrementContentVersionNumber () const
 

Detailed Description

Copyright (c) 1993-2022 Robert McNeel & Associates. All rights reserved. OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert McNeel & Associates.

THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.

For complete openNURBS copyright information see http://www.opennurbs.org.

Member Enumeration Documentation

◆ PER_VIEWPORT_SETTINGS

enum ON_Layer::PER_VIEWPORT_SETTINGS : unsigned int

Interface The PER_VIEWPORT_SETTINGS enum defines the bits used to set masks in functions used to specify and query per viewport layer settings.

Enumerator
per_viewport_none 
per_viewport_id 
per_viewport_color 
per_viewport_plot_color 
per_viewport_plot_weight 
per_viewport_visible 
per_viewport_persistent_visibility 
per_viewport_all_settings 

Constructor & Destructor Documentation

◆ ON_Layer() [1/2]

ON_Layer::ON_Layer ( )

◆ ~ON_Layer()

ON_Layer::~ON_Layer ( )

◆ ON_Layer() [2/2]

ON_Layer::ON_Layer ( const ON_Layer )

Member Function Documentation

◆ Color()

ON_Color ON_Layer::Color ( ) const

/* use ON_Layer::SetPerViewportColor *‍/ ON_DEPRECATED void SetColor( ON_Color, const ON_UUID& ); Parameters: viewport_id - [in] If viewport_id is not nil, then the setting to use for a specific viewport is returned. Returns: The color used by objects on this layer that do not have a per object color set.

◆ CopyPerViewportSettings() [1/2]

bool ON_Layer::CopyPerViewportSettings ( const ON_Layer source_layer,
ON_UUID  viewport_id,
unsigned int  settings_mask 
)

Description: Copies specified per viewport settings from a source layer to this layer. Parameters: source_layer - [in] layer to copy settings from viewport_id - [in] viewport id to copy all per viewport settings from. If viewport_id is nil, then the per viewport settings for all viewports will be copied. settings_mask - [in] bits indicate which settings to copy Use the ON_Layer PER_VIEWPORT_SETTINGS enum to set the bits. Returns: True if the settings were copied, False if no per-viewport settings exist for the specified viewport_id.

◆ CopyPerViewportSettings() [2/2]

bool ON_Layer::CopyPerViewportSettings ( ON_UUID  source_viewport_id,
ON_UUID  destination_viewport_id 
)

Description: Copies all per viewport settings for the source_viewport_id Parameters: source_viewport_id - [in] viewport id to copy all per viewport settings from destination_viewport_id - [in] viewport od to copy all per viewport settings to Returns: True if the settings could be copied, False if no per-viewport settings exist for the source viewport id

◆ CullPerViewportSettings()

void ON_Layer::CullPerViewportSettings ( int  viewport_id_count,
const ON_UUID viewport_id_list 
)

Description: Cull unused per viewport layer settings. Parameters: viewport_id_count - [in] viewport_id_list - [in] Settings for any viewports NOT in the viewport_id_list[] are culled.

◆ CustomSectionStyle()

const ON_SectionStyle* ON_Layer::CustomSectionStyle ( ON_SectionStyle sectionStyle = nullptr) const

Description: Layers can have optional custom section styles associated with them. This function returns the custom section style if one exists. Parameters: sectionStyle [out] - if not nullptr and a custom section style exists, the data in the custom section style is copied to sectionStyle

◆ DeleteModelVisible()

void ON_Layer::DeleteModelVisible ( )

Description: Remove any model viewport visibility setting so the layer's overall setting will be used for all viewports.

◆ DeletePerViewportColor()

void ON_Layer::DeletePerViewportColor ( const ON_UUID viewport_id)

Description: Remove any per viewport layer color setting so the layer's overall setting will be used for all viewports. Parameters: viewport_id - [in] If viewport_id is not nil, then the setting for this viewport will be deleted. If viewport_id is nil, the all per viewport layer color settings will be removed.

◆ DeletePerViewportPlotColor()

void ON_Layer::DeletePerViewportPlotColor ( const ON_UUID viewport_id)

Description: Remove any per viewport plot color setting so the layer's overall setting will be used for all viewports. Parameters: viewport_id - [in] If viewport_id is not nil, then the setting for this viewport will be deleted. If viewport_id is nil, the all per viewport plot color settings will be removed.

◆ DeletePerViewportPlotWeight()

void ON_Layer::DeletePerViewportPlotWeight ( const ON_UUID viewport_id)

Description: Remove any per viewport plot weight setting so the layer's overall setting will be used for all viewports. Parameters: viewport_id - [in] If viewport_id is not nil, then the setting for this viewport will be deleted. If viewport_id is nil, the all per viewport plot weight settings will be removed.

◆ DeletePerViewportSettings()

void ON_Layer::DeletePerViewportSettings ( const ON_UUID viewport_id) const

Description: Delete per viewport layer settings. Parameters: viewport_id - [in] If viewport_id is not nil, then the settings for that viewport are deleted. If viewport_id is nil, then all per viewport settings are deleted.

◆ DeletePerViewportVisible()

void ON_Layer::DeletePerViewportVisible ( const ON_UUID viewport_id)

Description: Remove any per viewport visibility setting so the layer's overall setting will be used for all viewports. Parameters: viewport_id - [in] If viewport_id is not nil, then the setting for this viewport will be deleted. If viewport_id is nil, the all per viewport visibility settings will be removed.

◆ Dump()

void ON_Layer::Dump ( ON_TextLog ) const
overridevirtual

for debugging

Reimplemented from ON_Object.

◆ FromModelComponentRef()

static const ON_Layer* ON_Layer::FromModelComponentRef ( const class ON_ModelComponentReference model_component_reference,
const ON_Layer none_return_value 
)
static

Parameters: model_component_reference - [in] none_return_value - [in] value to return if ON_Layer::Cast(model_component_ref.ModelComponent()) is nullptr Returns: If ON_Layer::Cast(model_component_ref.ModelComponent()) is not nullptr, that pointer is returned. Otherwise, none_return_value is returned.

◆ GetPerViewportVisibilityViewportIds()

void ON_Layer::GetPerViewportVisibilityViewportIds ( ON_SimpleArray< ON_UUID > &  viewport_id_list) const

Description: Get a list of the viewport ids of viewports that that have per viewport visibility settings that override the default layer visibility setting ON_Layer::m_bVisible. Parameters: viewport_id_list - [out] List of viewport id's that have a per viewport visibility setting. If the returned list is empty, then there are no per viewport visibility settings. Returns: Number of ids added to the list.

◆ HasPerViewportSettings() [1/2]

bool ON_Layer::HasPerViewportSettings ( const ON_UUID viewport_id) const

Parameters: viewport_id - [in] If viewport_id is not nil, then checks for setting for that specific viewport. If viewport_id is nil, then checks for any viewport settings. Returns: True if the layer has per viewport settings.

◆ HasPerViewportSettings() [2/2]

bool ON_Layer::HasPerViewportSettings ( ON_UUID  viewport_id,
unsigned int  settings_mask 
) const

Parameters: viewport_id - [in] If viewport_id is not nil, then checks for per viewport settings for that specific viewport. If viewport_id is nil, then checks for per viewport settings in any viewport. settings_mask - [in] settings_mask is a bitfield that specifies which settings to check for. The bits are defined in the ON_Layer::PER_VIEWPORT_PROPERTIES enum. If you want to determine if the layer has any per viewport settings, then pass 0xFFFFFFFF. Returns: True if the layer has per viewport override for the specified settings.

◆ IgesLevel()

int ON_Layer::IgesLevel ( ) const

◆ IsValid()

bool ON_Layer::IsValid ( class ON_TextLog text_log = nullptr) const
overridevirtual

ON_Object overrides

Reimplemented from ON_Object.

◆ IsVisible() [1/2]

bool ON_Layer::IsVisible ( ) const

Returns: Returns true if objects on layer are visible. Remarks: Does not inspect per viewport settings. It is better to use the overload that take an ON_3dmView for visibility testing See Also: ON_Layer::SetVisible

◆ IsVisible() [2/2]

bool ON_Layer::IsVisible ( const class ON_3dmView view) const

Returns: Returns true if objects on layer are visible for a given view. See Also: ON_Layer::SetVisible

◆ IsVisibleAndLocked()

bool ON_Layer::IsVisibleAndLocked ( ) const

Returns: Value of (IsVisible() && IsLocked()).

◆ IsVisibleAndNotLocked()

bool ON_Layer::IsVisibleAndNotLocked ( ) const

Returns: Value of (IsVisible() && !IsLocked()).

◆ LinetypeIndex()

int ON_Layer::LinetypeIndex ( ) const

Returns: The index of the linetype used by objects on this layer that do not have a per object linetype set.

◆ ModelIsVisible()

bool ON_Layer::ModelIsVisible ( ) const

Returns: Returns true if objects on layer are visible in model viewports. See Also: ON_Layer::IsVisible() ON_Layer::PerViewportIsVisible()

◆ ModelPersistentVisibility()

bool ON_Layer::ModelPersistentVisibility ( ) const

Returns: true: If this layer's visibility in model viewports is controlled by a parent object and the parent is turned on (after being off), then this layer will also be turned on in the specified viewport. false: If this layer's visibility in model viewports is controlled by a parent object and the parent layer is turned on (after being off), then this layer will continue to be off in the specified viewport. Remarks: See ON_Layer::SetPersistentVisibility for a description of persistent visibility. See Also: ON_Layer::SetModelPersistentVisibility

◆ ObjectType()

ON::object_type ON_Layer::ObjectType ( ) const
overridevirtual

Description: Useful for switch statements that need to differentiate between basic object types like points, curves, surfaces, and so on.

Returns: ON::object_type enum value.

Remarks: The default implementation of this virtual function returns ON::unknown_object_type

Reimplemented from ON_Object.

◆ operator=()

ON_Layer& ON_Layer::operator= ( const ON_Layer )

◆ ParentLayerId()

ON_UUID ON_Layer::ParentLayerId ( ) const

Layers are organized in a hierarchical structure (like file folders). If a layer is in a parent layer, then m_parent_layer_id is the id of the parent layer.

◆ PersistentLocking()

bool ON_Layer::PersistentLocking ( ) const

Description: The persistent locking setting is used for layers that can be locked by a "parent" object. A common case is when a layer is a child layer (ON_Layer.m_parent_id is not nil). In this case, when a parent layer is locked, then child layers are also locked. The persistent locking setting determines what happens when the parent is unlocked again. Returns: true: If this layer's locking is controlled by a parent object and the parent is unlocked (after being locked), then this layer will also be unlocked. false: If this layer's locking is controlled by a parent object and the parent layer is unlocked (after being locked), then this layer will continue to be locked. Remarks: When the persistent locking is not explicitly set, this function returns the current value of IsLocked(). See Also: ON_Layer::SetPersistentLocking ON_Layer::UnsetPersistentLocking

◆ PersistentVisibility()

bool ON_Layer::PersistentVisibility ( ) const

Description: The persistent visibility setting is used for layers whose visibility can be changed by a "parent" object. A common case is when a layer is a child layer (ON_Layer.m_parent_id is not nil). In this case, when a parent layer is turned off, then child layers are also turned off. The persistent visibility setting determines what happens when the parent is turned on again. Returns: true: If this layer's visibility is controlled by a parent object and the parent is turned on (after being off), then this layer will also be turned on. false: If this layer's visibility is controlled by a parent object and the parent layer is turned on (after being off), then this layer will continue to be off. Remarks: When the persistent visibility is not explicitly set, this function returns the current value of IsVisible(). See Also: ON_Layer::SetPersistentVisibility ON_Layer::UnsetPersistentVisibility

◆ PerViewportColor()

ON_Color ON_Layer::PerViewportColor ( ON_UUID  viewport_id) const

Parameters: viewport_id - [in] If viewport_id is not nil, then the setting to use for a specific viewport is returned. Returns: The color used by objects in the specified viewport and on this layer that do not have a per object color set.

◆ PerViewportIsVisible()

bool ON_Layer::PerViewportIsVisible ( ON_UUID  viewport_id) const

Parameters: viewport_id - [in] If viewport_id is not nil, then the visibility setting for that viewport is returned.

If viewport_id is nil, the ON_Layer::IsVisible() is returned. Returns: Returns true if objects on layer are visible.

◆ PerViewportIsVisibleInNewDetails()

bool ON_Layer::PerViewportIsVisibleInNewDetails ( ) const

Description: Returns true if a layer's per-viewport visibility property will be true, initially, in newly created detail views.

◆ PerViewportPersistentVisibility()

bool ON_Layer::PerViewportPersistentVisibility ( ON_UUID  viewport_id) const

/* use ON_Layer::SetPerViewportVisible *‍/ ON_DEPRECATED void SetVisible( bool, const ON_UUID& ); Parameters: viewport_id - [in] id of a viewport. If viewport_id is nil, then ON_Layer::PersistentVisibility() is returned. Returns: true: If this layer's visibility in the specified viewport is controlled by a parent object and the parent is turned on (after being off), then this layer will also be turned on in the specified viewport. false: If this layer's visibility in the specified viewport is controlled by a parent object and the parent layer is turned on (after being off), then this layer will continue to be off in the specified viewport. Remarks: See ON_Layer::SetPersistentVisibility for a description of persistent visibility. See Also: ON_Layer::SetPerViewportPersistentVisibility

◆ PerViewportPlotColor()

ON_Color ON_Layer::PerViewportPlotColor ( ON_UUID  viewport_id) const

Parameters: viewport_id - [in] If viewport_id is not nil, then the setting to use for a specific viewport is returned. Returns: The plotting color used by objects on this layer that do not have a per object color set.

◆ PerViewportPlotWeight()

double ON_Layer::PerViewportPlotWeight ( ON_UUID  viewport_id) const

◆ PerViewportSettingsCRC()

ON__UINT32 ON_Layer::PerViewportSettingsCRC ( ) const

Description: The PerViewportSettingsCRC() can be used to determine when layers have different per viewport settings.

◆ PlotColor()

ON_Color ON_Layer::PlotColor ( ) const

Returns: The plotting color used by objects on this layer that do not have a per object color set.

◆ PlotWeight()

double ON_Layer::PlotWeight ( ) const

Description: Get the weight (thickness) of the plotting pen. Returns: Thickness of the plotting pen in millimeters. A thickness of 0.0 indicates the "default" pen weight should be used. A thickness of -1.0 indicates the layer should not be printed.

◆ Read()

bool ON_Layer::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.

◆ RemoveCustomSectionStyle()

void ON_Layer::RemoveCustomSectionStyle ( )

Description: Remove any custom section style associated with this layer

◆ RenderMaterialIndex()

int ON_Layer::RenderMaterialIndex ( ) const

◆ SetColor()

void ON_Layer::SetColor ( ON_Color  layer_color)

layer display color

Description: Set the color used by objects on this layer that do not have a per object color set Parameters: layer_color - [in] Passing ON_UNSET_COLOR will clear the settings. viewport_id - [in] If viewport_id is not nil, then the setting applies only to the viewport with the specified id.

◆ SetCustomSectionStyle()

void ON_Layer::SetCustomSectionStyle ( const ON_SectionStyle sectionStyle)

a tree control then the list of child layers is shown in the control. Sections are the product of intersecting a plane with an object. For surface type geometry (ON_Brep, ON_Extrusion, ON_SubD, ON_Mesh) this intersection can result in curves as well as hatches for the closed curves generated Description: Layers can have optional custom section style associated with them. This function adds a custom section style for this layer.

◆ SetIgesLevel()

bool ON_Layer::SetIgesLevel ( int  )

IGES level for this layer.

◆ SetLinetypeIndex()

bool ON_Layer::SetLinetypeIndex ( int  linetype_index)

Description: Set the index of the linetype used by objects on this layer that do not have a per object linetypes Parameters: linetype_index - [in] Passing -1 will clear the setting.

◆ SetLocked()

void ON_Layer::SetLocked ( bool  bLocked)

Description: Controls layer locked Parameters: bLocked - [in] True to lock layer False to unlock layer See Also: ON_Layer::IsLocked

◆ SetModelPersistentVisibility()

void ON_Layer::SetModelPersistentVisibility ( bool  bPersistentVisibility)

Description: This function allows model viewports setting the child visibility property. Parameters bPersistentVisibility - [in] Remarks: See ON_Layer::SetPersistentVisibility for a description of the child visibility property. See Also: ON_Layer::SetPersistentVisibility

◆ SetModelVisible()

void ON_Layer::SetModelVisible ( bool  bVisible)

Description: Controls layer visibility in in model viewports. Parameters: bVisible - [in] true to make layer visible, false to make layer invisible See Also: ON_Layer::SetVisible() ON_Layer::SetPerViewportVisible()

◆ SetParentLayerId()

void ON_Layer::SetParentLayerId ( ON_UUID  parent_layer_id)

◆ SetPersistentLocking()

void ON_Layer::SetPersistentLocking ( bool  bPersistentLocking)

Description: Set the persistent locking setting for this layer. Parameters: bPersistentLocking - [in] persistent locking for this layer. Remarks: See ON_Layer::PersistentLocking for a detailed description of persistent locking. See Also: ON_Layer::PersistentLocking ON_Layer::UnsetPersistentLocking

◆ SetPersistentVisibility()

void ON_Layer::SetPersistentVisibility ( bool  bPersistentVisibility)

Description: Set the persistent visibility setting for this layer. Parameters: bPersistentVisibility - [in] persistent visibility setting for this layer. Remarks: See ON_Layer::PersistentVisibility for a detailed description of persistent visibility. See Also: ON_Layer::PersistentVisibility ON_Layer::UnsetPersistentVisibility

◆ SetPerViewportColor()

void ON_Layer::SetPerViewportColor ( ON_UUID  viewport_id,
ON_Color  layer_color 
)

Description: Set the color used by objects on this layer that do not have a per object color set Parameters: viewport_id - [in] If viewport_id is not nil, then the setting applies only to the viewport with the specified id. layer_color - [in] Passing ON_UNSET_COLOR will clear the settings.

◆ SetPerViewportIsVisibleInNewDetails()

void ON_Layer::SetPerViewportIsVisibleInNewDetails ( bool  bVisible)

◆ SetPerViewportPersistentVisibility()

void ON_Layer::SetPerViewportPersistentVisibility ( ON_UUID  viewport_id,
bool  bPersistentVisibility 
)

Description: This function allows per viewport setting the child visibility property. Parameters viewport_id - [in] bPersistentVisibility - [in] Remarks: See ON_Layer::SetPersistentVisibility for a description of the child visibility property. See Also: ON_Layer::SetPersistentVisibility

◆ SetPerViewportPlotColor()

void ON_Layer::SetPerViewportPlotColor ( ON_UUID  viewport_id,
ON_Color  plot_color 
)

◆ SetPerViewportPlotWeight()

void ON_Layer::SetPerViewportPlotWeight ( ON_UUID  viewport_id,
double  plot_weight_mm 
)

Description: Set the weight of the plotting pen. Parameters: plot_weight_mm - [in] Set the thickness of the plotting pen in millimeters. 0.0 means use the default pen width which is a Rhino app setting. -1.0 means layer does not print (still displays on the screen)

◆ SetPerViewportVisible()

void ON_Layer::SetPerViewportVisible ( ON_UUID  viewport_id,
bool  bVisible 
)

Description: Controls layer visibility in specific viewports. Parameters: viewport_id - [in] If viewport_id is not nil, then the setting applies only to the viewport with the specified id. If viewport_id is nil, then the setting applies to all viewports with per viewport layer settings. bVisible - [in] true to make layer visible, false to make layer invisible See Also: ON_Layer::PerViewportIsVisible()

◆ SetPlotColor()

void ON_Layer::SetPlotColor ( ON_Color  plot_color)

plotting color

Description: Set the plotting color used by objects on this layer that do not have a per object plotting color set Parameters: plot_color - [in] Passing ON_UNSET_COLOR will clear the settings. viewport_id - [in] If viewport_id is not nil, then the setting applies only to the viewport with the specified id.

◆ SetPlotWeight()

void ON_Layer::SetPlotWeight ( double  plot_weight_mm)

/* use ON_Layer::PerViewportPlotWeight *‍/ ON_DEPRECATED double PlotWeight( const ON_UUID& ) const; Description: Set the weight of the plotting pen. Parameters: plot_weight_mm - [in] Set the thickness of the plotting pen in millimeters. 0.0 means use the default pen width which is a Rhino app setting. -1.0 means layer does not print (still displays on the screen)

◆ SetRenderMaterialIndex()

bool ON_Layer::SetRenderMaterialIndex ( int  )

index of layer's rendering material

Index of render material for objects on this layer that have MaterialSource() == ON::material_from_layer. A material index of -1 indicates no material has been assigned and the material created by the default ON_Material constructor should be used.

◆ SetVisible()

void ON_Layer::SetVisible ( bool  bVisible)

Description: Controls layer visibility Parameters: bVisible - [in] true to make layer visible, false to make layer invisible viewport_id - [in] If viewport_id is not nil, then the setting applies only to the viewport with the specified id. See Also: ON_Layer::IsVisible

◆ UnsetModelPersistentVisibility()

void ON_Layer::UnsetModelPersistentVisibility ( )

◆ UnsetPersistentLocking()

void ON_Layer::UnsetPersistentLocking ( )

Description: Remove any explicitly persistent locking settings from this layer. Remarks: See ON_Layer::PersistentLocking for a detailed description of persistent locking. See Also: ON_Layer::PersistentLocking ON_Layer::SetPersistentLocking

◆ UnsetPersistentVisibility()

void ON_Layer::UnsetPersistentVisibility ( )

Description: Remove any explicit persistent visibility setting from this layer. When persistent visibility is not explicitly set, the value of ON_Layer::IsVisible() is used. Remarks: See ON_Layer::PersistentVisibility for a detailed description of persistent visibility. See Also: ON_Layer::PersistentVisibility ON_Layer::SetPersistentVisibility

◆ UnsetPerViewportPersistentVisibility()

void ON_Layer::UnsetPerViewportPersistentVisibility ( ON_UUID  viewport_id)

◆ UpdateReferencedComponents()

bool ON_Layer::UpdateReferencedComponents ( const class ON_ComponentManifest source_manifest,
const class ON_ComponentManifest destination_manifest,
const class ON_ManifestMap manifest_map 
)
overridevirtual

Description: Uses the destination_manifest to update references to other components. This is typically done when a component's references came from a "source" context and are being updated to the "destination" context. For example, inserting one model into another when index, id, and name conflicts need to be resolved at the time of insertion. Parameters: source_manifest - [in] A manifest of the source context with indices and ids corresponding to the current component references. If this manifest is not available, pass ON_ComponentManifest::Empty. destination_manifest - [in] A manifest of the destination context with indices and ids corresponding to the desired component references. If this manifest is not available, pass ON_ComponentManifest::Empty. manifest_map - [in] A map from the source (current) referenced component index/id values to the destination (desired) component index/id values. Returns: True if successful. False indicates a referenced component was not found in the manifest and the reference was changed to a default value. Example: If this object is an ON_Layer, the line pattern and render material references are updated. If this object is an ON_DimStyle, the text style reference is updated. If this object is an ON_3dmObjectAttributes, the layer, material, line pattern, and group references are updated.

Reimplemented from ON_Object.

◆ UpdateViewportIds()

int ON_Layer::UpdateViewportIds ( const ON_UuidPairList viewport_id_map)

Description: Use UpdateViewportIds() to change viewport ids in situations like merging when a viewport id conflict requires the viewport ids in a file to be changed. Returns: Number of viewport ids that were updated.

◆ Write()

bool ON_Layer::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.

Member Data Documentation

◆ Default

const ON_Layer ON_Layer::Default
static

index = -1, id set, unique and persistent

◆ m_bExpanded

bool ON_Layer::m_bExpanded = true

0.0 means use the default width (a Rhino app setting) -1.0 means layer does not print (still visible on screen) If true, when the layer table is displayed in

◆ m_color

ON_Color ON_Layer::m_color = ON_Color::Black

Layer display attributes. If m_display_material_id is nil, then m_color is the layer color and defaults are used for all other display attributes. If m_display_material_id is not nil, then some complicated scheme is used to decide what objects on this layer look like. In all cases, m_color is a good choice if you don't want to deal with m_display_material_id. In Rhino, m_display_material_id is used to identify a registry entry that contains user specific display preferences.

◆ m_display_material_id

ON_UUID ON_Layer::m_display_material_id = ON_nil_uuid

◆ m_iges_level

int ON_Layer::m_iges_level = -1

IGES level number if this layer was made during IGES import.

◆ m_linetype_index

int ON_Layer::m_linetype_index = -1

index of linetype

◆ m_material_index

int ON_Layer::m_material_index = -1

Rendering material: If you want something simple and fast, set m_material_index to the index of your rendering material and ignore m_rendering_attributes. If you are developing a fancy plug-in renderer, and a user is assigning one of your fabulous rendering materials to this layer, then add rendering material information to the m_rendering_attributes.m_materials[] array.

Developers: As soon as m_rendering_attributes.m_materials[] is not empty, rendering material queries slow down. Do not populate m_rendering_attributes.m_materials[] when setting m_material_index will take care of your needs.

◆ m_plot_color

ON_Color ON_Layer::m_plot_color = ON_Color::UnsetColor

Layer printing (plotting) attributes.

printing color

◆ m_plot_weight_mm

double ON_Layer::m_plot_weight_mm = 0.0

ON_UNSET_COLOR means use layer color.

printing pen thickness in mm

◆ m_rendering_attributes

ON_RenderingAttributes ON_Layer::m_rendering_attributes

◆ Unset

const ON_Layer ON_Layer::Unset
static

index = ON_UNSET_INT_INDEX, id = nil