Go to Google Code Home
Google SketchUp SkpWriter C++ API Documentation (Labs)

Public Member Functions

atlast::sketchup::ISketchUpEntityContainer Interface Reference

An interface covering those objects that can contain and create other Entities. More...

#include <ientitycontainer.h>

Inheritance diagram for atlast::sketchup::ISketchUpEntityContainer:
atlast::sketchup::ISketchUpEntity atlast::sketchup::ISketchUpObject

List of all members.

Public Member Functions

virtual bool Fill (atlast::geometry::CPoint3d pnts[], int numPoints, FaceDescriptor faces[], int numFaces, bool weldVertices=false)=0
 Fills an empty EntityContainer with faces.
virtual ISketchUpEdgePtr CreateEdge (ISketchUpVertex *pStart, ISketchUpVertex *pEnd) THROWS(ISketchUpException &)=0
 Creates an Edge in this container.
virtual long CreateFaces (const atlast::geometry::CPolygonMesh &mesh, unsigned int flags=0, ISketchUpMaterial *pFrontMaterial=NULL, ISketchUpMaterial *pBackMaterial=NULL, ISketchUpFaceVectorPtr *ppFaces=NULL)=0
 Create a collection of faces from a polygon mesh.

Detailed Description

An interface covering those objects that can contain and create other Entities.

This class can be used as a factory, with all the create methods contained within. Each create method will create the desired object and add it to "this" object.

This class can also be used to query for objects of the underlying types. It is a container in that sense.


Member Function Documentation

virtual ISketchUpEdgePtr atlast::sketchup::ISketchUpEntityContainer::CreateEdge ( ISketchUpVertex pStart,
ISketchUpVertex pEnd 
) [pure virtual]

Creates an Edge in this container.

The two given vertices must be valid for this to succeed.

Exceptions:
ISketchUpException In the case of invalid input - in particular, implementations of the ISketchUpVertex interface that are not recognized internally.
Parameters:
pStart The start vertex for the edge.
pEnd The end vertex for the edge.
Returns:
The edge between the start and end vertices.
virtual long atlast::sketchup::ISketchUpEntityContainer::CreateFaces ( const atlast::geometry::CPolygonMesh &  mesh,
unsigned int  flags = 0,
ISketchUpMaterial *  pFrontMaterial = NULL,
ISketchUpMaterial *  pBackMaterial = NULL,
ISketchUpFaceVectorPtr ppFaces = NULL 
) [pure virtual]

Create a collection of faces from a polygon mesh.

Parameters:
mesh The mesh used to create the faces.
flags A combination of

  • HIDE_BASED_ON_INDEX
  • SOFTEN_BASED_ON_INDEX
  • AUTO_SOFTEN
  • SMOOTH_SOFT_EDGES

The default value is AUTO_SOFTEN | SMOOTH_SOFT_EDGES.

pFrontMaterial The material to use on the front sides of the faces.
pBackMaterial The material to use on the back sides of the faces.
ppFaces If not NULL, filled in with the created faces.
Returns:
The number of faces created.
virtual bool atlast::sketchup::ISketchUpEntityContainer::Fill ( atlast::geometry::CPoint3d  pnts[],
int  numPoints,
FaceDescriptor  faces[],
int  numFaces,
bool  weldVertices = false 
) [pure virtual]

Fills an empty EntityContainer with faces.

This method is the fastest way to populate an EntityContainer with faces. This method achieves this performance by making certain assumptions about the data, and the state of the container:

  • The container must be empty.
  • The data must be consistent: no duplicate faces or points, inner loops live within the given faces, etc.

By virtue of the FaceDescriptor, EdgeDescriptor and MaterialDescriptor a client can create textured faces with zero or more inner loops. The user also has control over the basic attributes of each edge: hidden, soft and smooth. Again, it is the responsibility of the user to ensure that the data is consistent.

Parameters:
pnts An array of all the vertices used by the faces and the inner loops.
numPoints The number of points used by the outer loops of the faces. This number is less than or equal to the total number of points in the pnts parameter.
faces An array of FaceDescriptor objects.
numFaces The number of items in the faces parameter.
weldVertices If true, all coincident vertices will be joined. The default is false since this is a slight performance hit.
Returns:
true iff all the faces were created.

©2010 Google - Google Home - About Google