MaterialTable
Inheritance Hierarchy
System.Object
Rhino.FileIO.CommonComponentTable. Material.
Rhino.DocObjects.Tables.RhinoDocCommonTable. Material.
Rhino.DocObjects.Tables.MaterialTable
Namespace: Rhino.DocObjects.Tables
Assembly: RhinoCommon (in RhinoCommon.dll)
Syntax
public sealed class MaterialTable : RhinoDocCommonTable<Material>, ICollection<Material>, IEnumerable<Material>, IEnumerable
The MaterialTable type exposes the following members.
Properties
Name
Description
Public Property
ComponentType
(Overrides
CommonComponentTable.T..ComponentType
.)Public Property
Count
Returns the count of all items, including deleted ones.
(Inherited from CommonComponentTable.T..)
Public Property
CurrentMaterialIndex
At all times, there is a “current” material. Unless otherwise specified, new objects are assigned to the current material. The current material is never locked, hidden, or deleted.
Public Property
CurrentMaterialSource
Gets or sets the current material source.
Public Property
Document
Document that owns this table.
(Inherited from RhinoDocCommonTable.T..)
Public Property
Item
Conceptually, the material table is an array of materials. The operator[] can be used to get individual materials. A material is either active or deleted and this state is reported by Material.IsDeleted.
Methods
Name
Description
Public Method
Add.
Adds a new material to the table based on the default material.
Public Method
Add(Material)
Adds a new material to the table based on a given material.
Public Method
Add(Material, Boolean)
Adds a new material to the table based on a given material.
Public Method
Clear
Marks all items as deleted.
(Inherited from CommonComponentTable.T..)
Public Method
Delete
(Overrides
CommonComponentTable.T..Delete(T)
.)Public Method
DeleteAt
Removes a material at a specific position from this material table.
Public Method
Equals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public Method
Find(Guid, Boolean)
Finds a material with a matching id.
Public Method
Find(Material, Boolean)
Finds a material index.
Public Method
Find(String, Boolean)
Finds a material with a given name.
Public Method
FindId
Uses the guid to find a model component. Deleted objects cannot be found by id. The guid is the value that is stored in the .Id property. In a single document, no two active objects have the same guid. If an object is replaced with a new object, then the guid persists. For example, if the _Move command moves an object, then the moved object inherits its guid from the starting object. If the Copy command copies an object, then the copy gets a new guid. This guid persists through file saving/opening operations. This function will not find grip objects.
(Inherited from CommonComponentTable.T..)
Public Method
FindIndex
Retrieves a Material object based on Index. This search type of search is discouraged. We are moving towards using only IDs for all tables.
Public Method
GetEnumerator
Returns the enumerator that yields all items.
(Inherited from CommonComponentTable.T..)
Public Method
GetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public Method
GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public Method
Modify
Modify material settings.
Public Method
ResetMaterial
Public Method
ToString
Returns a string that represents the current object.
(Inherited from Object.)