Class Model
Implements
Inherited Members
Namespace: CADability
Assembly: CADability.dll
Syntax
[Serializable]
public class Model : IShowPropertyImpl, IShowProperty, IPropertyEntry, ISerializable, IGeoObjectOwner, IEnumerable, ICommandHandler, ICategorizedDislayLists, IDeserializationCallback, IJsonSerialize, IJsonSerializeDone
Constructors
| Improve this Doc View SourceModel()
Creates an empty model.
Declaration
public Model()
Model(SerializationInfo, StreamingContext)
Constructor required by deserialization
Declaration
protected Model(SerializationInfo info, StreamingContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Runtime.Serialization.SerializationInfo | info | SerializationInfo |
| System.Runtime.Serialization.StreamingContext | context | StreamingContext |
Properties
| Improve this Doc View SourceAllDrives
Returns the list of all IDrive of this model. Only used in connection with AnimatedView.
Declaration
public DriveList AllDrives { get; }
Property Value
| Type | Description |
|---|---|
| DriveList |
AllObjects
Returns a list of all objects owned by this model. Removing or adding objects from or to the returned list doesn't remove or add the objects from or to the model.
Declaration
public GeoObjectList AllObjects { get; }
Property Value
| Type | Description |
|---|---|
| GeoObjectList |
AllSchedules
Returns the list of all Schedules of this model. Only used in connection with AnimatedView.
Declaration
public ScheduleList AllSchedules { get; }
Property Value
| Type | Description |
|---|---|
| ScheduleList |
ContextMenu
Declaration
public override MenuWithHandler[] ContextMenu { get; }
Property Value
| Type | Description |
|---|---|
| MenuWithHandler[] |
Overrides
| Improve this Doc View SourceCount
Returns the count of GeoObjects in this model.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
EntryType
Overrides EntryType, returns GroupTitle.
Declaration
public override ShowPropertyEntryType EntryType { get; }
Property Value
| Type | Description |
|---|---|
| ShowPropertyEntryType |
Overrides
| Improve this Doc View SourceExtent
Returns the extent of the model, i.e. a bounding cube enclosing all objects.
Declaration
public BoundingCube Extent { get; set; }
Property Value
| Type | Description |
|---|---|
| BoundingCube |
Item[Int32]
Indexer to access the GeoObjects owned by this model by index.
Declaration
public IGeoObject this[int Index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | Index | Index of the required GeoObject |
Property Value
| Type | Description |
|---|---|
| IGeoObject |
LabelText
Declaration
public override string LabelText { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Overrides
| Improve this Doc View SourceLabelType
Overrides LabelType,
Declaration
public override ShowPropertyLabelFlags LabelType { get; }
Property Value
| Type | Description |
|---|---|
| ShowPropertyLabelFlags |
Overrides
| Improve this Doc View SourceMinExtend
A minimal extend of the Model. This will be the extend of the Model if the Model is empty. This is also used in other circumstances (e.g. dieplay of the grid)
Declaration
public BoundingCube MinExtend { get; set; }
Property Value
| Type | Description |
|---|---|
| BoundingCube |
Name
The name of the model.
Declaration
public string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
NoSingleAddEvents
Set to true, if you don't want AddingGeoObjectEvent rsp. GeoObjectAddedEvent beeing fired after AddingGeoObjectsEvent rsp. GeoObjectsAddedEvent has been called. False is the default value.
Declaration
public bool NoSingleAddEvents { set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
OctTree
Access to the OctTree containing all geometrical objects of the model. Do not modify the octtree to avoid inconsitencies between model and octtree. Use the octtree for fast access to the objects in the model from geometrical constraints.
Declaration
public OctTree<IGeoObject> OctTree { get; }
Property Value
| Type | Description |
|---|---|
| OctTree<IGeoObject> |
SubEntries
Overrides SubEntries, returns the subentries in this property view.
Declaration
public override IShowProperty[] SubEntries { get; }
Property Value
| Type | Description |
|---|---|
| IShowProperty[] |
Overrides
| Improve this Doc View SourceSubEntriesCount
Overrides SubEntriesCount, returns the number of subentries in this property view.
Declaration
public override int SubEntriesCount { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Overrides
| Improve this Doc View SourceUndo
Gets or sets the undo-system. Usually this is the undosystem of the Project containing this model.
Declaration
public UndoRedoSystem Undo { get; set; }
Property Value
| Type | Description |
|---|---|
| UndoRedoSystem |
UserData
Declaration
public UserData UserData { get; }
Property Value
| Type | Description |
|---|---|
| UserData |
Methods
| Improve this Doc View SourceAdd(GeoObjectList)
Adds multiple GeoObjects to this model.
Declaration
public void Add(GeoObjectList ListToAdd)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoObjectList | ListToAdd | List of the GeoObjects to add |
Add(IGeoObject)
Adds an object to this model. If the model is beeing displayed the object will appear in the view immediately.
Declaration
public void Add(IGeoObject ObjectToAdd)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeoObject | ObjectToAdd | The GeoObject to add |
Add(IGeoObject[])
Adds multiple GeoObjects to this model.
Declaration
public void Add(IGeoObject[] ListToAdd)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeoObject[] | ListToAdd | Array of the GeoObjects to add |
AdjustPoint(SnapPointFinder, Projection, Set<Layer>)
Adjusts the point defined by spf (SourcePoint and Projection)
according to the settings of spf (SnapPointFinder.SnapModes and other properties)
by checking all objects in the visibleLayers.
As a result SnapPoint and DidSnap will be set.
Declaration
public void AdjustPoint(SnapPointFinder spf, Projection projection, Set<Layer> visibleLayers)
Parameters
| Type | Name | Description |
|---|---|---|
| SnapPointFinder | spf | Point to be adjusted and mode how to adjust |
| Projection | projection | Projection |
| Set<Layer> | visibleLayers | Visible layers to consider |
AdjustPoint(SnapPointFinder, Set<Layer>)
Searches for the best point in this model which corresponds to the mouse position and the
active snap modes. Mouse position and snap modes are contained in the spf
parameter, where also the result is returned
Declaration
public void AdjustPoint(SnapPointFinder spf, Set<Layer> visibleLayers)
Parameters
| Type | Name | Description |
|---|---|---|
| SnapPointFinder | spf | SnapPointFinder class which contains the snap mode and the mouse position |
| Set<Layer> | visibleLayers | Layers to be included in the search |
ClearDisplayLists()
Deprecated, still public for legacy reasons.
Declaration
public void ClearDisplayLists()
Finalize()
Declaration
protected void Finalize()
GetExtent(Projection)
Returns a 2 dimensional bounding rctangle enclosing the projection of all GeoObjects of the model.
Declaration
public BoundingRect GetExtent(Projection pr)
Parameters
| Type | Name | Description |
|---|---|---|
| Projection | pr | The projection to be applied to the GeoObjects |
Returns
| Type | Description |
|---|---|
| BoundingRect |
GetObjectsFromBox(BoundingCube)
Returns all objects of the model that are inside ore close to the provided box.
Declaration
public GeoObjectList GetObjectsFromBox(BoundingCube box)
Parameters
| Type | Name | Description |
|---|---|---|
| BoundingCube | box | Box from which to seek objects |
Returns
| Type | Description |
|---|---|
| GeoObjectList | List of objects in or close to the box |
GetObjectsFromRect(BoundingRect, Projection, Set<Layer>, PickMode, FilterList)
Returns all objects of the model that are touched by the pickrect, whos layers are in the
visibleLayers set and which are accepted by the filterList.
Declaration
public GeoObjectList GetObjectsFromRect(BoundingRect pickrect, Projection projection, Set<Layer> visibleLayers, PickMode pickMode, FilterList filterList)
Parameters
| Type | Name | Description |
|---|---|---|
| BoundingRect | pickrect | Area that specifies which objects are beeing tested |
| Projection | projection | The projection in which the pickrect is defined |
| Set<Layer> | visibleLayers | Set of layers which are visible (and hence should be used for the test) |
| PickMode | pickMode | Single or multiple objects |
| FilterList | filterList | List of conditions |
Returns
| Type | Description |
|---|---|
| GeoObjectList | List of objects that fulfill all conditions |
GetObjectsFromRect(Projection.PickArea, Set<Layer>, PickMode, FilterList, GeoObjectList)
Returns all objects of the model that are touched by the area, whos layers are in the
visibleLayers set and which are accepted by the filterList.
Declaration
public GeoObjectList GetObjectsFromRect(Projection.PickArea area, Set<Layer> visibleLayers, PickMode pickMode, FilterList filterList, GeoObjectList toAvoid = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Projection.PickArea | area | Area that specifies which objects are beeing tested |
| Set<Layer> | visibleLayers | Set of layers which are visible (and hence should be used for the test) |
| PickMode | pickMode | Single or multiple objects |
| FilterList | filterList | List of conditions |
| GeoObjectList | toAvoid | List of objects not to select |
Returns
| Type | Description |
|---|---|
| GeoObjectList | List of objects that fulfill all conditions |
IsAttributeUsed(Object)
Determins whether an attribute (e.g. Layer, LinePattern) is used by any GeoObjects of this model.
Declaration
public bool IsAttributeUsed(object Attribute)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | Attribute | Attribut to test |
Returns
| Type | Description |
|---|---|
| System.Boolean | True, if attribute is used, false otherwise. |
LabelChanged(String)
Overrides LabelChanged(String)
Declaration
public override void LabelChanged(string NewText)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | NewText |
Overrides
| Improve this Doc View SourceMoveToBack(IGeoObject)
Declaration
public void MoveToBack(IGeoObject iGeoObject)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeoObject | iGeoObject |
MoveToFront(IGeoObject)
Declaration
public void MoveToFront(IGeoObject iGeoObject)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeoObject | iGeoObject |
ParallelTriangulation(Double)
Declaration
public void ParallelTriangulation(double precision)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | precision |
Remove(GeoObjectList)
Removes a list of GeoObjects from this model. Objects that dont belong to the model will be ignored.
Declaration
public void Remove(GeoObjectList ToRemove)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoObjectList | ToRemove | List of GeoObjects to be removed |
Remove(IGeoObject)
Removes a GeoObject from the model. If the GeoObject doesnt belong to this model it will be ignored.
Declaration
public void Remove(IGeoObject ToRemove)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeoObject | ToRemove | GeoObject to remove |
Remove(IGeoObject[])
Removes an array of GeoObjects from this model. Objects that dont belong to the model will be ignored.
Declaration
public void Remove(IGeoObject[] ToRemove)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeoObject[] | ToRemove | Array of geoObjects to remove |
Remove(HashSet<IGeoObject>)
Declaration
public void Remove(HashSet<IGeoObject> HToRemove)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.HashSet<IGeoObject> | HToRemove |
RemoveAll()
Remove all objects from this model.
Declaration
public void RemoveAll()
RemoveSolid(Solid, Boolean)
Removes the given solid from all other solids in the model. If there are no solids in the model or this solid is disjoint with all other solids in the model there will be no effect.
Declaration
public bool RemoveSolid(Solid solid, bool onlySameLayer)
Parameters
| Type | Name | Description |
|---|---|---|
| Solid | solid | the solid to remove |
| System.Boolean | onlySameLayer | if true: check only with solids on the same layer |
Returns
| Type | Description |
|---|---|
| System.Boolean |
UniteSolid(Solid, Boolean)
Unites the given solid with all other solids in the model. If there are no other solids or the solid is disjoint with all other solids this solid will simply bee added.
Declaration
public bool UniteSolid(Solid solid, bool onlySameLayer)
Parameters
| Type | Name | Description |
|---|---|---|
| Solid | solid | the solid to unite |
| System.Boolean | onlySameLayer | if true: check only with solids on the same layer |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Events
| Improve this Doc View SourceAddingGeoObjectEvent
This event will be fired before an object is added to this model. The event handler can prevent the object beeing added to the model
Declaration
public event Model.AddingGeoObject AddingGeoObjectEvent
Event Type
| Type | Description |
|---|---|
| Model.AddingGeoObject |
AddingGeoObjectsEvent
This event will be fired before multiple objects are beeing added. There is no sense in modifying the provided array of objects. There will be an additional call to AddingGeoObjectEvent and GeoObjectAddedEvent for each objects (where you can prevent the object beeing added) and a final call to GeoObjectsAddedEvent.
Declaration
public event Model.AddingGeoObjects AddingGeoObjectsEvent
Event Type
| Type | Description |
|---|---|
| Model.AddingGeoObjects |
CalculateExtentForZoomTotalEvent
Declaration
public event Model.CalculateExtentForZoomTotalDelegate CalculateExtentForZoomTotalEvent
Event Type
| Type | Description |
|---|---|
| Model.CalculateExtentForZoomTotalDelegate |
ExtentChangedEvent
This event will be fired when objects have been added, removed or modified which resulted in a different extent (of the bounding box) of the model.
Declaration
public event Model.ExtentChangedDelegate ExtentChangedEvent
Event Type
| Type | Description |
|---|---|
| Model.ExtentChangedDelegate |
GeoObjectAddedEvent
This event will be fired when an object is added to this model.
Declaration
public event Model.GeoObjectAdded GeoObjectAddedEvent
Event Type
| Type | Description |
|---|---|
| Model.GeoObjectAdded |
GeoObjectDidChangeEvent
This event will be fired when an object contained in this model did change.
Declaration
public event ChangeDelegate GeoObjectDidChangeEvent
Event Type
| Type | Description |
|---|---|
| ChangeDelegate |
GeoObjectRemovedEvent
This event will be fired when an object is removed from this model.
Declaration
public event Model.GeoObjectRemoved GeoObjectRemovedEvent
Event Type
| Type | Description |
|---|---|
| Model.GeoObjectRemoved |
GeoObjectsAddedEvent
This event will be fired after multiple GeoObjects have been added, AddingGeoObjectsEvent has been fired before.
Declaration
public event Model.GeoObjectsAdded GeoObjectsAddedEvent
Event Type
| Type | Description |
|---|---|
| Model.GeoObjectsAdded |
GeoObjectsRemovedEvent
This event will be fired when removing multiple objects from this model is finished.
Declaration
public event Model.GeoObjectsRemoved GeoObjectsRemovedEvent
Event Type
| Type | Description |
|---|---|
| Model.GeoObjectsRemoved |
GeoObjectWillChangeEvent
This event will be fired when an object contained in this model is about to change.
Declaration
public event ChangeDelegate GeoObjectWillChangeEvent
Event Type
| Type | Description |
|---|---|
| ChangeDelegate |
ImportingObjectsEvent
This event will be fired when objects imported from another file are added to the model. The event handler can modify the list of objects, e.g. add or remove objects or combine the objects to a Block.
Declaration
public event Model.ImportingObjectsDelegate ImportingObjectsEvent
Event Type
| Type | Description |
|---|---|
| Model.ImportingObjectsDelegate |
NameChangedEvent
This event will be fired when the name of the model changed.
Declaration
public event Model.NameChangedDelegate NameChangedEvent
Event Type
| Type | Description |
|---|---|
| Model.NameChangedDelegate |
RemovingGeoObjectEvent
This event will be fired before an object is removed from this model. The event handler can prevent the object beeing added to the model
Declaration
public event Model.RemovingGeoObject RemovingGeoObjectEvent
Event Type
| Type | Description |
|---|---|
| Model.RemovingGeoObject |
RemovingGeoObjectsEvent
This event will be fired before multiple objects are beeing removed. There is no sense in modifying the provided array of objects. There will be an additional call to RemovingGeoObjectEvent and GeoObjectRemovedEvent for each objects (where you can prevent the object beeing added) and a final call to GeoObjectsRemovedEvent.
Declaration
public event Model.RemovingGeoObjects RemovingGeoObjectsEvent
Event Type
| Type | Description |
|---|---|
| Model.RemovingGeoObjects |
Explicit Interface Implementations
| Improve this Doc View SourceICategorizedDislayLists.Add(Layer, Boolean, Boolean, IGeoObject)
Declaration
void ICategorizedDislayLists.Add(Layer layer, bool addToFace, bool addToLinear, IGeoObject go)
Parameters
| Type | Name | Description |
|---|---|---|
| Layer | layer | |
| System.Boolean | addToFace | |
| System.Boolean | addToLinear | |
| IGeoObject | go |
IJsonSerialize.GetObjectData(IJsonWriteData)
Declaration
void IJsonSerialize.GetObjectData(IJsonWriteData data)
Parameters
| Type | Name | Description |
|---|---|---|
| IJsonWriteData | data |
IJsonSerialize.SetObjectData(IJsonReadData)
Declaration
void IJsonSerialize.SetObjectData(IJsonReadData data)
Parameters
| Type | Name | Description |
|---|---|---|
| IJsonReadData | data |
IJsonSerializeDone.SerializationDone()
Declaration
void IJsonSerializeDone.SerializationDone()
ICommandHandler.OnCommand(String)
Declaration
bool ICommandHandler.OnCommand(string MenuId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | MenuId |
Returns
| Type | Description |
|---|---|
| System.Boolean |
ICommandHandler.OnSelected(MenuWithHandler, Boolean)
Declaration
void ICommandHandler.OnSelected(MenuWithHandler selectedMenuItem, bool selected)
Parameters
| Type | Name | Description |
|---|---|---|
| MenuWithHandler | selectedMenuItem | |
| System.Boolean | selected |
ICommandHandler.OnUpdateCommand(String, CommandState)
Declaration
bool ICommandHandler.OnUpdateCommand(string MenuId, CommandState CommandState)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | MenuId | |
| CommandState | CommandState |
Returns
| Type | Description |
|---|---|
| System.Boolean |
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
| Type | Description |
|---|---|
| System.Collections.IEnumerator |
IDeserializationCallback.OnDeserialization(Object)
Declaration
void IDeserializationCallback.OnDeserialization(object sender)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | sender |
ISerializable.GetObjectData(SerializationInfo, StreamingContext)
Declaration
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Runtime.Serialization.SerializationInfo | info | |
| System.Runtime.Serialization.StreamingContext | context |