Interface IGeoObject
IGeoObject is the interface that all geometric entities must support (see GeoObject).
Inherited Members
Namespace: CADability.GeoObject
Assembly: CADability.dll
Syntax
public interface IGeoObject : ILayer, IStyle, IOctTreeInsertable, IComparable
Properties
| Improve this Doc View SourceActuator
Gets or sets an actuator or drive that defines the mechanical constraint or degree of freedom for this object Used for animation, static objects dont have an actuator (null)
Declaration
IDrive Actuator { get; set; }
Property Value
| Type | Description |
|---|---|
| IDrive |
Attributes
Gets all attributes that this GeoObject posesses.
Declaration
INamedAttribute[] Attributes { get; }
Property Value
| Type | Description |
|---|---|
| INamedAttribute[] |
CustomAttributeKeys
Gets all custom attributes attached to this object
Declaration
string[] CustomAttributeKeys { get; }
Property Value
| Type | Description |
|---|---|
| System.String[] |
Description
Returns a description of the GeoObject which is used in the control center
Declaration
string Description { get; }
Property Value
| Type | Description |
|---|---|
| System.String | a short description |
IsVisible
Declaration
bool IsVisible { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
NumChildren
Returns the number of children the GeoObject has. Simple GeoObjects (like Line) dont have children.
Declaration
int NumChildren { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
OwnedItems
Declaration
IGeoObject[] OwnedItems { get; }
Property Value
| Type | Description |
|---|---|
| IGeoObject[] |
Owner
Returns the owner of this GeoObject. Each GeoObject has only one owner. This might be a Model or a GeoObject derived from Block.
Declaration
IGeoObjectOwner Owner { get; set; }
Property Value
| Type | Description |
|---|---|
| IGeoObjectOwner |
PreferredStyle
Declaration
Style.EDefaultFor PreferredStyle { get; }
Property Value
| Type | Description |
|---|---|
| Style.EDefaultFor |
UniqueId
Declaration
int UniqueId { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
UserData
Gets the user data collection for this GeoObject. This is the way to connect your own objects with a GeoObject. See UserData.
Declaration
UserData UserData { get; }
Property Value
| Type | Description |
|---|---|
| UserData |
Methods
| Improve this Doc View SourceAttributeChanged(INamedAttribute)
This method is called to notify the object of an attribute that changed some of its properties. The objects returns true, if it needs to be repainted.
Declaration
bool AttributeChanged(INamedAttribute attribute)
Parameters
| Type | Name | Description |
|---|---|---|
| INamedAttribute | attribute |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Child(Int32)
Returns the child with the given index. See HasChildren().
Declaration
IGeoObject Child(int Index)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | Index | index of required child |
Returns
| Type | Description |
|---|---|
| IGeoObject | this child |
Clone()
Clones this GeoObject.
Declaration
IGeoObject Clone()
Returns
| Type | Description |
|---|---|
| IGeoObject | the cloned GeoObject |
CopyAttributes(IGeoObject)
Copies the attributes from the given GeoObject to this GeoObject. The geometry remains unchanged.
Declaration
void CopyAttributes(IGeoObject ToCopyFrom)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeoObject | ToCopyFrom | GeoObject to copy from |
CopyGeometry(IGeoObject)
Copies the geometrical aspects of the given GeoObject to this GeoObject. Both objects must be of the same type. The attributes are not copied.
Declaration
void CopyGeometry(IGeoObject ToCopyFrom)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeoObject | ToCopyFrom | GeoObject to copy from |
Decompose()
Declaration
GeoObjectList Decompose()
Returns
| Type | Description |
|---|---|
| GeoObjectList |
FindSnapPoint(SnapPointFinder)
Asks the object to enumerate all its possible snap points according to the required modes defined by the parameter.
Declaration
void FindSnapPoint(SnapPointFinder spf)
Parameters
| Type | Name | Description |
|---|---|---|
| SnapPointFinder | spf | definition and collection of snap points |
GetAttributeProperties(IFrame)
Gets a list of IShowProperty objects that represent the non geometric properties of this geoobject. This list will be used during construct actions (e.g. when interactively drawing that object) to display properties like color or layer.
Declaration
IShowProperty[] GetAttributeProperties(IFrame Frame)
Parameters
| Type | Name | Description |
|---|---|---|
| IFrame | Frame | IFrame reference used to check settings |
Returns
| Type | Description |
|---|---|
| IShowProperty[] | list of properties |
GetBoundingCube()
Returns a bounding cube of the object. The object must fir into this cube. There may be a smaller cube that contains the object if it is to expensive to calculate the exact cube.
Declaration
BoundingCube GetBoundingCube()
Returns
| Type | Description |
|---|---|
| BoundingCube | the bounding cube |
GetExtent(Projection, ExtentPrecision)
Declaration
BoundingRect GetExtent(Projection projection, ExtentPrecision extentPrecision)
Parameters
| Type | Name | Description |
|---|---|---|
| Projection | projection | |
| ExtentPrecision | extentPrecision |
Returns
| Type | Description |
|---|---|
| BoundingRect |
GetNamedAttribute(String)
Gets an attribut from the GeoObject. There are the following types (keys) of attributes predefined in CADability, which can be set with this method:
Other attributes may be provided by the user.
Declaration
INamedAttribute GetNamedAttribute(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | key or typename of the required attribute |
Returns
| Type | Description |
|---|---|
| INamedAttribute | the attribute or null, if there is no such attribute |
GetQuadTreeItem(Projection, ExtentPrecision)
Declaration
IQuadTreeInsertableZ GetQuadTreeItem(Projection projection, ExtentPrecision extentPrecision)
Parameters
| Type | Name | Description |
|---|---|---|
| Projection | projection | |
| ExtentPrecision | extentPrecision |
Returns
| Type | Description |
|---|---|
| IQuadTreeInsertableZ |
GetShowProperties(IFrame)
Gets a IShowProperty object that represents the properties of this geoobject. The result will be used to display the properties in the control center.
Declaration
IShowProperty GetShowProperties(IFrame Frame)
Parameters
| Type | Name | Description |
|---|---|---|
| IFrame | Frame | IFrame reference used to check settings |
Returns
| Type | Description |
|---|---|
| IShowProperty | properties |
HasChildren()
Determins whether this GeoObject has child objects. E.g. Block objects have children. This is necessary when the child objects have different Layers
Declaration
bool HasChildren()
Returns
| Type | Description |
|---|---|
| System.Boolean |
HasValidData()
Determins whether the GeoObject has valid data (e.g. to be added to a model). E.g. a line where the startpoint is identical to the endpoint or a circle with radius <=0.0 is considered invalid.
Declaration
bool HasValidData()
Returns
| Type | Description |
|---|---|
| System.Boolean | true, if valid, false otherwise |
IsAttributeUsed(Object)
Returns true if this object uses the attribute in the parameter. Attributes may be CADability objects like Layer etc. or any user defined objects.
Declaration
bool IsAttributeUsed(object Attribute)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | Attribute | attribut to check |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if used by this GeoObject |
Modify(ModOp)
Modifies this GeoObject with the given ModOp (includes moving, rotating, reflecting, scaling etc.).
Declaration
void Modify(ModOp m)
Parameters
| Type | Name | Description |
|---|---|---|
| ModOp | m | Operation to be applied |
ModifyWithMouse(Object, String, Boolean)
Notifies about the begin and end of a modification with the mouse
Declaration
bool ModifyWithMouse(object sender, string propertyName, bool startModify)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | sender | the causer |
| System.String | propertyName | name of the property beeing changed |
| System.Boolean | startModify | true: beginning, false: ending |
Returns
| Type | Description |
|---|---|
| System.Boolean |
PaintTo3D(IPaintTo3D)
Paint the object to the 3D display machine and returns a (possibly cached) displaylist
Declaration
void PaintTo3D(IPaintTo3D paintTo3D)
Parameters
| Type | Name | Description |
|---|---|---|
| IPaintTo3D | paintTo3D | where to paint |
PaintTo3DList(IPaintTo3D, ICategorizedDislayLists)
Declaration
void PaintTo3DList(IPaintTo3D paintTo3D, ICategorizedDislayLists lists)
Parameters
| Type | Name | Description |
|---|---|---|
| IPaintTo3D | paintTo3D | |
| ICategorizedDislayLists | lists |
PrePaintTo3D(IPaintTo3D)
Called before PaintTo3D, not collected in the DisplayList
Declaration
void PrePaintTo3D(IPaintTo3D paintTo3D)
Parameters
| Type | Name | Description |
|---|---|---|
| IPaintTo3D | paintTo3D |
PrepareDisplayList(Double)
This method will be called from a background thread when a higher precision displaylist is needed. The object should do all the necessary calculation to produce a display list with the required precision. The display list will later be acquired by a call to PaintTo3DList (or PaintTo3D) from the main thred because the display dirvers are not multithread enabled.
Declaration
void PrepareDisplayList(double precision)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | precision | The required precision |
PropagateAttributes(Layer, ColorDef)
Propagates the layer and color from the owner (usually a BlockRef) to this object.
Declaration
void PropagateAttributes(Layer layer, ColorDef colorDef)
Parameters
| Type | Name | Description |
|---|---|---|
| Layer | layer | The layer |
| ColorDef | colorDef | The color |
SetNamedAttribute(String, INamedAttribute)
Sets an attribut to the GeoObject. There are the following types (keys) of attributes predefined in CADability, which can be set with this method:
Other attributes may be provided by the user.
Declaration
void SetNamedAttribute(string key, INamedAttribute toSet)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | key or typename of attribute to set |
| INamedAttribute | toSet | attribute |
UpdateAttributes(IAttributeListContainer)
When an IGeoObject changes the context that contains the lists of attributes it must replace its attributes by those given in the new context. If there are no appropriate attributes in the new context, these attributes must be included int this new context. This happens when drag and drop operations are executed or when a model is copied from one project to another project. IGeoObjectImpl contains a complete implementation regarding the attributes Style, Layer, ColorDef, LineWidth, LinePattern, HatchStyle and DimensionStyle
Declaration
void UpdateAttributes(IAttributeListContainer alc)
Parameters
| Type | Name | Description |
|---|---|---|
| IAttributeListContainer | alc | The context, usually a Project which contains the attribute lists |
Events
| Improve this Doc View SourceDidChangeEvent
Event that must be provided by each GeoObject. This event will be fired when the GeoObject did change (either geometrical aspects or attributes).
Declaration
event ChangeDelegate DidChangeEvent
Event Type
| Type | Description |
|---|---|
| ChangeDelegate |
WillChangeEvent
Event that must be provided by each GeoObject. This event will be fired when the GeoObject is about to change (either geometrical aspects or attributes).
Declaration
event ChangeDelegate WillChangeEvent
Event Type
| Type | Description |
|---|---|
| ChangeDelegate |