Top level OpenNURBS objects have geometry and attributes. The geometry is stored in some class derived from ON_Geometry and the attributes are stored in an ON_3dmObjectAttributes class. Examples of attributes are object name, object id, display attributes, group membership, layer membership, and so on. More...
#include <opennurbs_3dm_attributes.h>
Public Member Functions | |
ON_3dmObjectAttributes () | |
attributes of geometry and dimension table objects More... | |
~ON_3dmObjectAttributes () | |
bool | AddDisplayMaterialRef (ON_DisplayMaterialRef display_material) |
Add a display material reference to the attributes. If there is an existing entry with a matching viewport id, the existing entry is replaced. More... | |
void | AddToGroup (int) |
unsigned int | ApplyParentalControl (const ON_3dmObjectAttributes &parent_attributes, const ON_Layer &parent_layer, unsigned int control_limits=0xFFFFFFFF) |
If "this" has attributes (color, plot weight, ...) with "by parent" sources, then the values of those attributes on parent_attributes are copied. More... | |
ON::object_color_source | ColorSource () const |
const ON_MeshParameters * | CustomRenderMeshParameters () const |
void | Default () |
Initializes all attributes to the default values. More... | |
void | DeleteCustomRenderMeshParameters () |
Deletes any per object mesh parameters. More... | |
int | DisplayMaterialRefCount () const |
void | Dump (ON_TextLog &) const override |
virtual More... | |
bool | EnableCustomRenderMeshParameters (bool bEnable) |
bool | FindDisplayMaterialId (const ON_UUID &viewport_id, ON_UUID *display_material_id=nullptr) const |
Quick way to see if a viewport has a special material. More... | |
bool | FindDisplayMaterialRef (const ON_DisplayMaterialRef &search_material, ON_DisplayMaterialRef *found_material=nullptr) const |
display material references More... | |
int | GetGroupList (ON_SimpleArray< int > &) const |
int | GroupCount () const |
group interface More... | |
const int * | GroupList () const |
bool | IsInGroup (int) const |
Returns true if object is in group with the specified index. More... | |
bool | IsInGroups (int, const int *) const |
Returns true if the object is in any of the groups in the list. More... | |
bool | IsInGroups (const ON_SimpleArray< int > &) const |
Returns true if object is in any of the groups in the list. More... | |
bool | IsInstanceDefinitionObject () const |
Use this query to determine if an object is part of an instance definition. More... | |
bool | IsValid (class ON_TextLog *text_log=nullptr) const override |
Tests an object to see if its data members are correctly initialized. More... | |
bool | IsVisible () const |
ON::object_linetype_source | LinetypeSource () const |
ON::object_material_source | MaterialSource () const |
Determine if the simple material should come from the object or from it's layer. High quality rendering plug-ins should use m_rendering_attributes. More... | |
ON::object_mode | Mode () const |
Interface ////////////////////////////////////////////////////////. More... | |
const ON_wString | Name () const |
bool | operator!= (const ON_3dmObjectAttributes &) const |
bool | operator== (const ON_3dmObjectAttributes &) const |
ON::plot_color_source | PlotColorSource () const |
ON::plot_weight_source | PlotWeightSource () const |
bool | Read (ON_BinaryArchive &) override |
virtual More... | |
void | RemoveAllDisplayMaterialRefs () |
Remove a the entire display material reference list. More... | |
bool | RemoveDisplayMaterialRef (ON_UUID viewport_id, ON_UUID display_material_id=ON_nil_uuid) |
Remove a display material reference from the list. More... | |
void | RemoveFromAllGroups () |
Removes object from all groups. More... | |
void | RemoveFromGroup (int) |
void | RemoveFromTopGroup () |
removes the object from the last group in the group list More... | |
void | SetColorSource (ON::object_color_source) |
bool | SetCustomRenderMeshParameters (const class ON_MeshParameters &mp) |
void | SetLinetypeSource (ON::object_linetype_source) |
void | SetMaterialSource (ON::object_material_source ms) |
Specifies if the simple material should be the one indicated by the material index or the one indicated by the object's layer. More... | |
void | SetMode (ON::object_mode) |
bool | SetName (const wchar_t *name, bool bFixInvalidName) |
void | SetPlotColorSource (ON::plot_color_source) |
void | SetPlotWeightSource (ON::plot_weight_source) |
void | SetVisible (bool bVisible) |
Controls object visibility More... | |
unsigned int | SizeOf () const override |
virtual More... | |
int | TopGroup () const |
bool | Transform (const ON_Xform &xform) |
bool | UpdateReferencedComponents (const class ON_ComponentManifest &source_manifest, const class ON_ComponentManifest &destination_manifest, const class ON_ManifestMap &manifest_map) override |
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. More... | |
bool | Write (ON_BinaryArchive &) const override |
virtual More... | |
Public Member Functions inherited from ON_Object | |
ON_Object () ON_NOEXCEPT | |
ON_Object (const ON_Object &) | |
virtual | ~ON_Object () |
virtual ON_AggregateComponentStatus | AggregateComponentStatus () const |
Call whenever a component status setting is modifed by directly changing it on a component in a way that will result in any saved information about the parent object's aggretate component status becoming invalid. More... | |
bool | AttachUserData (class ON_UserData *pUserData) |
Attach user data to an object. More... | |
unsigned int | ClearAllComponentStates () const |
Set all active level component states to ON_ComponentStatus::NoneSet. More... | |
virtual unsigned int | ClearComponentStates (ON_ComponentStatus states_to_clear) const |
Clear the specified states on every component. More... | |
virtual unsigned int | ClearComponentStates (ON_COMPONENT_INDEX component_index, ON_ComponentStatus states_to_clear) const |
Clear states on an individual component. More... | |
unsigned int | CopyUserData (const ON_Object &source_object, ON_UUID source_userdata_item_id, ON_Object::UserDataConflictResolution userdata_conflict_resolution) |
Expert user tool that copies user data items with positive values of ON_UserData.m_userdata_copycount from source_object to "this. More... | |
void | CopyUserData (const ON_Object &source_object) |
Calls CopyUserData(source_object,ON_Object::UserDataConflictResolution::source_object). More... | |
virtual ON__UINT32 | DataCRC (ON__UINT32 current_remainder) const |
Returns a CRC calculated from the information that defines the object. This CRC can be used as a quick way to see if two objects are not identical. More... | |
virtual bool | DeleteComponents (const ON_COMPONENT_INDEX *ci_list, size_t ci_count) |
Delete the portions of the object identified in ci_list[]. More... | |
virtual void | DestroyRuntimeCache (bool bDelete=true) |
Expert user function. If you are using openNURBS in its default configuration to read and write 3dm archives, you never need to call this function. Many objects employ lazy creation of (runtime) caches that save information to help speed geometric calculations. This function will destroy all runtime information. More... | |
bool | DetachUserData (class ON_UserData *pUserData) |
Remove user data from an object. More... | |
void | EmergencyDestroy () |
Sets m_user_data_list = 0. More... | |
class ON_UserData * | FirstUserData () const |
User data is stored as a linked list of ON_UserData classes. FirstUserData gets the first item in the linked list. This is the most recent item attached using AttachUserData(). Remark: To iterate through all the user data on an object, call FirstUserData() and then use ON_UserData::Next() to traverse the list. More... | |
virtual unsigned int | GetComponentsWithSetStates (ON_ComponentStatus states_filter, bool bAllEqualStates, ON_SimpleArray< ON_COMPONENT_INDEX > &components) const |
class ON_UserData * | GetUserData (const ON_UUID &userdata_uuid) const |
Get a pointer to user data. More... | |
bool | GetUserString (const wchar_t *key, ON_wString &string_value) const |
Get user string from the object. More... | |
int | GetUserStringKeys (ON_ClassArray< ON_wString > &user_string_keys) const |
Get a list of all user string keys on the object. More... | |
int | GetUserStrings (ON_ClassArray< ON_UserString > &user_strings) const |
Get a list of all user strings on the object. More... | |
bool | IsKindOf (const ON_ClassId *pClassId) const |
Low level tool to test if an object is derived from a specified class. More... | |
virtual void | MarkAggregateComponentStatusAsNotCurrent () const |
Call whenever a component status setting is modifed by directly changing it on a component in a way that will result in any saved information about the parent object's aggretate component status becoming invalid. More... | |
virtual void | MemoryRelocate () |
The MemoryRelocate() function is called when an object's location in memory is changed. For example, if an object resides in a chunk of memory that is grown by calling a realloc that has to allocate a new chunk and copy the contents of the old chunk to the new chunk, then the location of the object's memory changes. In practice this happens when classes derived from ON_Object are stored in dynamic arrays, like the default implementation of ON_ObjectArray<>'s that use realloc to grow the dynamic array. More... | |
virtual ON_UUID | ModelObjectId () const |
All objects in an opennurbs model have an id ( ON_Layer.m_layer_id, ON_Font.m_font_id, ON_Material.m_material_id, ON_3dmObjectAttributes.m_uuid ). More... | |
unsigned int | MoveUserData (ON_Object &source_object, ON_UUID source_userdata_item_id, ON_Object::UserDataConflictResolution userdata_conflict_resolution, bool bDeleteAllSourceItems) |
Expert user tool that moves user data items from source_object to "this. More... | |
void | MoveUserData (ON_Object &source_object) |
Calls MoveUserData(source_object,ON_Object::UserDataConflictResolution::source_object,true). More... | |
virtual ON::object_type | ObjectType () const |
Useful for switch statements that need to differentiate between basic object types like points, curves, surfaces, and so on. More... | |
ON_Object & | operator= (const ON_Object &) |
void | PurgeUserData () |
PurgeUserData() removes all user data from object. More... | |
virtual unsigned int | SetComponentStates (ON_COMPONENT_INDEX component_index, ON_ComponentStatus states_to_set) const |
Set states on an individual component. More... | |
virtual unsigned int | SetComponentStatus (ON_COMPONENT_INDEX component_index, ON_ComponentStatus status_to_copy) const |
Copy status settings to an individual component. More... | |
bool | SetUserString (const wchar_t *key, const wchar_t *string_value) |
Attach a user string to the object. This information will perisist through copy construction, operator=, and file IO. More... | |
int | SetUserStrings (int count, const ON_UserString *user_strings, bool bReplace) |
Append entries to the user string list More... | |
void | TransformUserData (const class ON_Xform &xform) |
Objects derived from ON_Geometry must call TransformUserData() in their Transform() member function. More... | |
int | UserStringCount () const |
Public Attributes | |
ON_Color | m_color |
int | m_display_order |
ON_SimpleArray< ON_DisplayMaterialRef > | m_dmref |
int | m_layer_index |
int | m_linetype_index |
int | m_material_index |
ON_wString | m_name |
ON::object_decoration | m_object_decoration |
Used to indicate an object has a decoration (like an arrowhead on a curve) More... | |
ON_Color | m_plot_color |
double | m_plot_weight_mm |
ON_ObjectRenderingAttributes | m_rendering_attributes |
ON::active_space | m_space |
ON_wString | m_url |
ON_UUID | m_uuid |
ON_UUID | m_viewport_id |
int | m_wire_density |
Static Public Attributes | |
static const ON_3dmObjectAttributes | DefaultAttributes |
static const ON_3dmObjectAttributes | Unset |
Additional Inherited Members | |
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 } |
When a userdata item is copied or moved from a source object to a destination object, the ON_Object::UserDataConflictResolution enum values specify how conficts are resolved. Remark: A userdata item "conflict" occurs when both the destination and source object have a user data item with the same value of ON_UserData::m_userdata_uuid. More... | |
Top level OpenNURBS objects have geometry and attributes. The geometry is stored in some class derived from ON_Geometry and the attributes are stored in an ON_3dmObjectAttributes class. Examples of attributes are object name, object id, display attributes, group membership, layer membership, and so on.
7 January 2003 Dale Lear Derived from ON_Object so ON_UserData can be attached to ON_3dmObjectAttributes.
ON_3dmObjectAttributes::ON_3dmObjectAttributes | ( | ) |
attributes of geometry and dimension table objects
ON_3dmObjectAttributes::~ON_3dmObjectAttributes | ( | ) |
bool ON_3dmObjectAttributes::AddDisplayMaterialRef | ( | ON_DisplayMaterialRef | display_material | ) |
Add a display material reference to the attributes. If there is an existing entry with a matching viewport id, the existing entry is replaced.
display_material | [in] |
void ON_3dmObjectAttributes::AddToGroup | ( | int | ) |
unsigned int ON_3dmObjectAttributes::ApplyParentalControl | ( | const ON_3dmObjectAttributes & | parent_attributes, |
const ON_Layer & | parent_layer, | ||
unsigned int | control_limits = 0xFFFFFFFF |
||
) |
If "this" has attributes (color, plot weight, ...) with "by parent" sources, then the values of those attributes on parent_attributes are copied.
parent_attributes | [in] |
parent_layer | [in] |
control_limits | [in] The bits in control_limits determine which attributes may may be copied. 1: visibility 2: color 4: render material 8: plot color 0x10: plot weight 0x20: linetype 0x40: display order |
1: visibility 2: color 4: render material 8: plot color 0x10: plot weight 0x20: linetype 0x40: display order
ON::object_color_source ON_3dmObjectAttributes::ColorSource | ( | ) | const |
const ON_MeshParameters* ON_3dmObjectAttributes::CustomRenderMeshParameters | ( | ) | const |
If the value of ON_MeshParameters::m_bCustomSettingsDisabled is true, then do no use these parameters to make a render mesh.
void ON_3dmObjectAttributes::Default | ( | ) |
Initializes all attributes to the default values.
void ON_3dmObjectAttributes::DeleteCustomRenderMeshParameters | ( | ) |
Deletes any per object mesh parameters.
int ON_3dmObjectAttributes::DisplayMaterialRefCount | ( | ) | const |
|
overridevirtual |
virtual
Reimplemented from ON_Object.
bool ON_3dmObjectAttributes::EnableCustomRenderMeshParameters | ( | bool | bEnable | ) |
bEnable | [in] true to enable use of the per object mesh parameters. false to disable use of the per object mesh parameters. |
Sets the value of ON_MeshParameters::m_bCustomSettingsDisabled to !bEnable
bool ON_3dmObjectAttributes::FindDisplayMaterialId | ( | const ON_UUID & | viewport_id, |
ON_UUID * | display_material_id = nullptr |
||
) | const |
Quick way to see if a viewport has a special material.
viewport_id | [in] |
display_material_id | [out] |
bool ON_3dmObjectAttributes::FindDisplayMaterialRef | ( | const ON_DisplayMaterialRef & | search_material, |
ON_DisplayMaterialRef * | found_material = nullptr |
||
) | const |
display material references
Searches for a matching display material. For a given viewport id, there is at most one display material. For a given display material id, there can be multiple viewports. If there is a display reference in the list with a nil viewport id, then the display material will be used in all viewports that are not explictly referenced in other ON_DisplayMaterialRefs.
search_material | [in] |
found_material | [out] |
If FindDisplayMaterialRef(), the input value of search_material is never changed. If FindDisplayMaterialRef() returns true, the chart shows the output value of display_material. When there are multiple possibilities for a match, the matches at the top of the chart have higher priority.
search_material found_material input value output value
(nil,nil) (nil,did) if (nil,did) is in the list. (nil,did) (vid,did) if (vid,did) is in the list. (nil,did) (nil,did) if (nil,did) is in the list. (vid,nil) (vid,did) if (vid,did) is in the list (vid,nil) (vid,did) if (nil,did) is in the list (vid,did) (vid,did) if (vid,did) is in the list.
int ON_3dmObjectAttributes::GetGroupList | ( | ON_SimpleArray< int > & | ) | const |
int ON_3dmObjectAttributes::GroupCount | ( | ) | const |
group interface
returns number of groups object belongs to
const int* ON_3dmObjectAttributes::GroupList | ( | ) | const |
bool ON_3dmObjectAttributes::IsInGroup | ( | int | ) | const |
Returns true if object is in group with the specified index.
bool ON_3dmObjectAttributes::IsInGroups | ( | int | , |
const int * | |||
) | const |
Returns true if the object is in any of the groups in the list.
bool ON_3dmObjectAttributes::IsInGroups | ( | const ON_SimpleArray< int > & | ) | const |
Returns true if object is in any of the groups in the list.
bool ON_3dmObjectAttributes::IsInstanceDefinitionObject | ( | ) | const |
Use this query to determine if an object is part of an instance definition.
|
overridevirtual |
Tests an object to see if its data members are correctly initialized.
text_log | [in] if the object is not valid and text_log is not nullptr, then a brief englis description of the reason the object is not valid is appened to the log. The information appended to text_log is suitable for |
low | level debugging purposes by programmers and is not intended to be useful as a high level user interface tool. |
Reimplemented from ON_Object.
bool ON_3dmObjectAttributes::IsVisible | ( | ) | const |
ON::object_linetype_source ON_3dmObjectAttributes::LinetypeSource | ( | ) | const |
ON::object_material_source ON_3dmObjectAttributes::MaterialSource | ( | ) | const |
Determine if the simple material should come from the object or from it's layer. High quality rendering plug-ins should use m_rendering_attributes.
ON::object_mode ON_3dmObjectAttributes::Mode | ( | ) | const |
Interface ////////////////////////////////////////////////////////.
const ON_wString ON_3dmObjectAttributes::Name | ( | ) | const |
bool ON_3dmObjectAttributes::operator!= | ( | const ON_3dmObjectAttributes & | ) | const |
bool ON_3dmObjectAttributes::operator== | ( | const ON_3dmObjectAttributes & | ) | const |
ON::plot_color_source ON_3dmObjectAttributes::PlotColorSource | ( | ) | const |
ON::plot_weight_source ON_3dmObjectAttributes::PlotWeightSource | ( | ) | const |
|
overridevirtual |
virtual
Reimplemented from ON_Object.
void ON_3dmObjectAttributes::RemoveAllDisplayMaterialRefs | ( | ) |
Remove a the entire display material reference list.
bool ON_3dmObjectAttributes::RemoveDisplayMaterialRef | ( | ON_UUID | viewport_id, |
ON_UUID | display_material_id = ON_nil_uuid |
||
) |
Remove a display material reference from the list.
viewport_id | [in] Any display material references with this viewport id will be removed. If nil, then viewport_id is ignored. |
display_material_id | [in] Any display material references that match the viewport_id and have this display_material_id will be removed. If nil, then display_material_id is ignored. |
void ON_3dmObjectAttributes::RemoveFromAllGroups | ( | ) |
Removes object from all groups.
void ON_3dmObjectAttributes::RemoveFromGroup | ( | int | ) |
void ON_3dmObjectAttributes::RemoveFromTopGroup | ( | ) |
removes the object from the last group in the group list
void ON_3dmObjectAttributes::SetColorSource | ( | ON::object_color_source | ) |
bool ON_3dmObjectAttributes::SetCustomRenderMeshParameters | ( | const class ON_MeshParameters & | mp | ) |
mp | [in] per object mesh parameters |
void ON_3dmObjectAttributes::SetLinetypeSource | ( | ON::object_linetype_source | ) |
void ON_3dmObjectAttributes::SetMaterialSource | ( | ON::object_material_source | ms | ) |
Specifies if the simple material should be the one indicated by the material index or the one indicated by the object's layer.
ms | [in] |
void ON_3dmObjectAttributes::SetMode | ( | ON::object_mode | ) |
bool ON_3dmObjectAttributes::SetName | ( | const wchar_t * | name, |
bool | bFixInvalidName | ||
) |
void ON_3dmObjectAttributes::SetPlotColorSource | ( | ON::plot_color_source | ) |
void ON_3dmObjectAttributes::SetPlotWeightSource | ( | ON::plot_weight_source | ) |
void ON_3dmObjectAttributes::SetVisible | ( | bool | bVisible | ) |
Controls object visibility
bVisible | [in] true to make object visible, false to make object invisible |
|
overridevirtual |
virtual
Reimplemented from ON_Object.
int ON_3dmObjectAttributes::TopGroup | ( | ) | const |
bool ON_3dmObjectAttributes::Transform | ( | const ON_Xform & | xform | ) |
|
overridevirtual |
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.
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. |
Reimplemented from ON_Object.
|
overridevirtual |
virtual
Reimplemented from ON_Object.
|
static |
ON_Color ON_3dmObjectAttributes::m_color |
int ON_3dmObjectAttributes::m_display_order |
ON_SimpleArray<ON_DisplayMaterialRef> ON_3dmObjectAttributes::m_dmref |
int ON_3dmObjectAttributes::m_layer_index |
int ON_3dmObjectAttributes::m_linetype_index |
int ON_3dmObjectAttributes::m_material_index |
ON_wString ON_3dmObjectAttributes::m_name |
ON::object_decoration ON_3dmObjectAttributes::m_object_decoration |
Used to indicate an object has a decoration (like an arrowhead on a curve)
ON_Color ON_3dmObjectAttributes::m_plot_color |
double ON_3dmObjectAttributes::m_plot_weight_mm |
ON_ObjectRenderingAttributes ON_3dmObjectAttributes::m_rendering_attributes |
ON::active_space ON_3dmObjectAttributes::m_space |
ON_wString ON_3dmObjectAttributes::m_url |
ON_UUID ON_3dmObjectAttributes::m_uuid |
ON_UUID ON_3dmObjectAttributes::m_viewport_id |
int ON_3dmObjectAttributes::m_wire_density |
|
static |