Class vdSectionClip
- Namespace
- VectorDraw.Professional.vdObjects
- Assembly
- VectorDraw.Professional.dll
Represents a section clipping plane that can be applied to a document or layout to hide geometry
on the side of the plane defined as "hidden".
Typically it is presenting as a member of a vdSectionClips collection that is attached to Sections of a vdLayout.
public sealed class vdSectionClip : vdBaseObject, IDisposable, IVDSerialise, ICloneable, IBaseObject
- Inheritance
-
vdSectionClip
- Implements
- Inherited Members
Examples
Add to section planes to a cube and see the sectioning result. Note that the section planes are created in a way that they cut through the cube and the visible side is towards the inside of the cube, so you can see the sectioning result clearly.
//create a cube with 6 different colors for each side to test the section plane
var vertexlist = new gPoints(new gPoint[]
{
//bottom face points
new gPoint(0,0,0),
new gPoint(1,0,0),
new gPoint(1,1,0),
new gPoint(0,1,0),
//top face points
new gPoint(0,0,1),
new gPoint(1,0,1),
new gPoint(1,1,1),
new gPoint(0,1,1),
});
var facelist = new Int32Array(new int[]
{
//bottom face with palette color 0(red)
1,2,3,4,0,
//top face with palette color 1(yellow)
5,6,7,8,1,
//front face with palette color 2(green)
1,2,6,5,2,
//back face with palette color 3(cyan)
4,3,7,8,3,
//left face with palette color 4(blue)
1,4,8,5,4,
//right face with palette color 5(magenta)
2,3,7,6,5,
});
var polyface = new vdPolyface(doc, vertexlist, facelist);
doc.Model.Entities.AddItem(polyface);
//add two section planes to cut the cube and see the result of sectioning
var section = doc.Model.Sections.Add("Section 1");
section.OriginPoint= new gPoint(0.5, 0.5, 0.6);
section.Direction = new Vector(0, 0, -1);
section.Enable = true;
section = doc.Model.Sections.Add("Section 2");
section.OriginPoint = new gPoint(0.5, 0.5, 0.4);
section.Direction = new Vector(0, 0, 1);
section.Enable = true;
//set the render mode to shade from South East view, to see the sectioning result
doc.Model.RenderMode = vdRender.Mode.Shade;
doc.CommandAction.View3D("VISE");
Remarks
A vdSectionClip defines a clipping plane using an OriginPoint and a Direction vector that defines the visible side. When Enable is true (and the object is not marked as Deleted), the clip affects rendering and geometry queries: points, lines, triangles and polygons can be tested or clipped against the plane. The class also supports drawing a filled face for the section plane (SectionColor) and rendering cover-face outlines.
The object maintains internal matrices used to transform between World Coordinate System (WCS) and the Section (ECS) coordinate system. Use Update() to recalculate derived state after changing properties such as OriginPoint or Direction.
Constructors
- vdSectionClip()
Initializes the vdSectionClip object.
- vdSectionClip(string, gPoint, Vector)
Initializes a new vdSectionClip object with passed parameters.
- vdSectionClip(string, gPoint, Vector, bool)
Initializes a new vdSectionClip object with passed parameters.
- vdSectionClip(vdDocument, string, gPoint, Vector)
Initializes a new vdSectionClip object with passed parameters.
- vdSectionClip(vdDocument, string, gPoint, Vector, bool)
Initializes a new vdSectionClip object with passed parameters.
Properties
- Deleted
Get/Set a property that marks the object as Deleted or not.
- Direction
Get/Set the direction vector of the vdSectionClip object.
- DrawSectionLines
Defines if section lines will rendered over the filled faces.Default value is true.
- Enable
Get/Set a boolean value representing if the clip is enabled or not.
- Name
Get/Set the name of the object.
- Object2SectionMatrix
Get the matrix used for transformations between Object and Section Coordinate System.
- OffsetDistance
Get/Set the distance in Drawing units to additionally draw Layout's entities. This distance is calculated from the Origin point and the opposite direction of the Section Clip.
- OffsetEntitiesColor
Get/Set the PenColor to be used for additional offset drawing of the entities. Note you can also set the AlphaBlending to have transparency.
- OriginPoint
Get/Set the Origin point in World Coordinate System(WCS).
- SectionAlphaBlending
The Transparency of the Section Clip if it is drawn. SectionColor
- SectionColor
Get/Set the Color of the drawable Section Clip.
Methods
- ClipLine(gPoint, gPoint, ref gPoint, ref gPoint)
Gets the visible portion of a line
- ClipTriangle(gPoint, gPoint, gPoint, out gPoint, out gPoint)
Checks if a triangle intersects with the section plane
- Clone()
Creates a new object with the same properties as this one.
- DeSerialize(DeSerializer, string, object)
This Function is called foreach field name of the vdSectionClip object when opening in vdml format.
- Dispose()
Releases all resources used by this object.
- Draw(vdRender)
Draws a solid rect with the SectionColor.
- DrawCoverFaces(vdRender)
Internally used.Draws all calculated cover faces for this Section.
- ~vdSectionClip()
Clears unmanaged resources before the object is reclaimed by garbage collection.
- InternalSetOwner(vdBaseObject)
Internally used only.
Set the object owner
- IsSectionVisible(gPoint)
Checks if the given point is at the visible side of the clip.
- IsSectionVisible(gPoint, Matrix)
Checks if the given point is at the visible side of the clip.
- IsSectionVisible(gPoints, Matrix)
Checks if the given points is at the visible side of the clip.
- OnDocumentSelected(vdDocument)
This method is called when the object is inserted in a Document for the first time.
- OnOwnerChanged()
This method is called when the object's owner is changed.
- Serialize(Serializer)
This Function is called when saving the vdSectionClip object to vdml format.
- ToString()
Gets a System.String that represents the Name of the vdSectionClip Object.
- Update()
Updates all calculated object values.