Method GetVisibleAreas
- Namespace
- VectorDraw.Professional.vdObjects
- Assembly
- VectorDraw.Professional.dll
GetVisibleAreas(vdEntities, vdSelection, double, int)
Create a PrimitivesExport.VisibleAreas object that is used to get the visible areas of passed entities at any view direction
public PrimitivesExport.VisibleAreas GetVisibleAreas(vdEntities entities, vdSelection subentities, double SquareRectSize, int RenderingSize)
Parameters
entitiesvdEntitiesA collection of objects that make up the entire drawing.
subentitiesvdSelectionA collection of vdFigures for which the visible area will be calculated in connection with the entire drawing.If it is null the visible area of passed entities will be calculated.
SquareRectSizedoubleDefines the size of small square in Drawing units that each surface is divided. Smaller values gets more time to calculate.
RenderingSizeintThe size of the temporary rendering context used to calculate the visible areas.Higher values require more time and offer better precision.Valid values between 640 , 2048.
Returns
- PrimitivesExport.VisibleAreas
An array of PrimitivesExport.RenderProperties.EntityViewAreas object type that contains information about the area of each passed vdFigure object in each view.
Examples
Get the projection areas of the given views collection of all grip selected entities in Model Layout. If there are no grip selected entities the visible area of all entities in model layout is calculated. Note: set the SquareRectSize to 0.01 that is 1 square centimeter in case we assume that 1 DrawingUnit represents 1 meter. The return area values will be in square Drawing Units (square meters in this case)
vdSelection set = doc.GetGripSelection();
if (set != null && set.Count == 0) set = null;
VectorDraw.Render.PrimitivesExport.VisibleAreas va = doc.GetVisibleAreas(doc.Model.Entities, set, 0.01, 1024);
for (int i = 0; i < 360; i += 36)
{
double x = Math.Cos(Globals.DegreesToRadians(i));
double y = Math.Sin(Globals.DegreesToRadians(i));
Vector v = new Vector(x, y, 1);
VectorDraw.Render.PrimitivesExport.RenderProperties.EntityViewAreas viewarea = va.GetEntitiesArea(v);
double surfacesVisibleArea = viewarea.Area(false); //get the visible area of all entities surfaces in specific view.
double ProjectionToViewArea = viewarea.Area(true); //get the area that projected on the specific view.
}
va.Dispose(); //Always dispose immediately after you have finished with visible area jobs
GetVisibleAreas(vdEntities, vdSelection, double)
Create a PrimitivesExport.VisibleAreas object that is used to get the visible areas of passed entities at any view direction
public PrimitivesExport.VisibleAreas GetVisibleAreas(vdEntities entities, vdSelection subentities, double SquareRectSize)
Parameters
entitiesvdEntitiesA collection of objects that make up the entire drawing.
subentitiesvdSelectionA collection of vdFigures for which the visible area will be calculated in connection with the entire drawing.If it is null the visible area of passed entities will be calculated.
SquareRectSizedoubleDefines the size of small square in Drawing units that each surface is divided. Smaller values gets more time to calculate.
Returns
- PrimitivesExport.VisibleAreas
An array of PrimitivesExport.RenderProperties.EntityViewAreas object type that contains information about the area of each passed vdFigure object in each view.
- See Also