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

Public Member Functions

atlast::sketchup::ISketchUpFace Interface Reference

A Face interface. More...

#include <iface.h>

Inheritance diagram for atlast::sketchup::ISketchUpFace:
atlast::sketchup::ISketchUpDrawingElement atlast::sketchup::ISketchUpGeometricElement atlast::sketchup::ISketchUpEntity atlast::sketchup::ISketchUpObject

List of all members.

Public Member Functions

virtual void AddInnerLoop (const ISketchUpCurveVector *curves) THROWS(ISketchUpException &)=0
 Adds an inner loop to the face.
virtual ISketchUpLoopPtr GetOuterLoop () const =0
 Retrieves the outer loop of this face.
virtual ISketchUpLoopVectorPtr GetInnerLoops () const =0
 Returns a vector of the inner loops for this face.
virtual void SetReversed (bool reverseIt=true)=0
 Directs the face to reverse its orientation.
virtual atlast::geometry::CPlane GetPlane () const =0
 Retrieves the plane defined by the face.
virtual
atlast::geometry::CPolygonMesh 
GetTriangulation () const =0
 Triangulates the face without any UV values.
virtual void SetFrontPushPins (const unsigned int length, const atlast::geometry::CPoint2d uvCoords[], const atlast::geometry::CPoint2d aaCoords[], const atlast::geometry::CUnitVector3d &projectionVector)=0
 Assigns the pushpin values to texture coordinates of the front side of the face.
virtual void SetBackPushPins (const unsigned int length, const atlast::geometry::CPoint2d uvCoords[], const atlast::geometry::CPoint2d aaCoords[], const atlast::geometry::CUnitVector3d &projectionVector)=0
 Assigns the pushpin values to texture coordinates of the back side of the face.

Detailed Description

A Face interface.

An ISketchUpFace is defined by an outer loop and a collection of inner loops. The outer loop is always traversed counter clockwise with respect to the normal of the face.

A loop is a connected collection of ISketchUpEdgeUse objects. An ISketchUpEdgeUse references an ISketchUpEdge along with a direction: is the ISketchUpEdgeUse using the ISketchUpEdge in the same direction as the Edge's "natural" orientation?

To better understand this, consider the following situation where one finds two polygons P1 and P2:

PolygonsWithEdges.PNG

The edges are oriented in such a way that P1's edges are traversed counterclockwise about its normal (assuming the normal extends out of the screen, as opposed to into the screen), whereas P2's edges are traversed clockwise.

In SketchUp, a face is defined by an outer loop which is traversed counterclockwise with respect to the face's normal. This loop object must somehow be defined in terms of the edges in the system, but clearly in this example there is a problem with using the edges directly for P2.

The SketchUp modeler addresses this problem by introducing edgeuses, which are little more than an object that encapsulates a reference to an edge along with a flag indicating whether the edgeuse should be traversed in the same direction as the edge, or reversed.

If we draw in the edge uses (denoted e#) then we might have:

PolygonsWithEdgeUses.PNG

The polygon denoted P1 is enclosed by the edges E1, E2, E3 and E4 via reference through edgeuses e1, e2, e3 and e4. These edgeuses do not reverse their orientation via their respective edges.

Openings are cuts in the face occuring because of a cut-component being attached to the face.

A Face is created via a ISketchUpEntityContainer.

See also:
ISketchUpEntityContainer
ISketchUpEdge
ISketchUpLoop
ISketchUpVertex
ISketchUpMaterial

Member Function Documentation

virtual void atlast::sketchup::ISketchUpFace::AddInnerLoop ( const ISketchUpCurveVector *  curves  )  [pure virtual]

Adds an inner loop to the face.

The inner loop effectively defines a "hole" in the face. The inner loop must truly be inner - it must lie within the face's outer loop.

Exceptions:
ISketchUpException Unrecognized input types - typically ISketchUpCurvePtr implementations that are foreign to this implementation.
Parameters:
curves The curves defining the inner loop.
virtual ISketchUpLoopVectorPtr atlast::sketchup::ISketchUpFace::GetInnerLoops (  )  const [pure virtual]

Returns a vector of the inner loops for this face.

If this face is not valid, an empty vector is returned.

Returns:
A vector of the inner loops for this face.
virtual ISketchUpLoopPtr atlast::sketchup::ISketchUpFace::GetOuterLoop (  )  const [pure virtual]

Retrieves the outer loop of this face.

If this face is not valid, NULL is returned.

Returns:
The outerloop.
virtual atlast::geometry::CPlane atlast::sketchup::ISketchUpFace::GetPlane (  )  const [pure virtual]

Retrieves the plane defined by the face.

If the face is not valid, a default plane is returned.

Returns:
The plane defined by the points on the face and the face's orientation.
virtual void atlast::sketchup::ISketchUpFace::SetBackPushPins ( const unsigned int  length,
const atlast::geometry::CPoint2d  uvCoords[],
const atlast::geometry::CPoint2d  aaCoords[],
const atlast::geometry::CUnitVector3d &  projectionVector 
) [pure virtual]

Assigns the pushpin values to texture coordinates of the back side of the face.

Parameters:
length The number of pushpins to assign. Valid values range from 0 to 4.
uvCoords The uv texture coordinates of each pushpin.
aaCoords The arbitrary axis point of each pushpin.
projection_vector The projection vector of the texture. A projection vector of 0.0, 0.0, 0.0 indicates that a projection vector is not used.
virtual void atlast::sketchup::ISketchUpFace::SetFrontPushPins ( const unsigned int  length,
const atlast::geometry::CPoint2d  uvCoords[],
const atlast::geometry::CPoint2d  aaCoords[],
const atlast::geometry::CUnitVector3d &  projectionVector 
) [pure virtual]

Assigns the pushpin values to texture coordinates of the front side of the face.

Parameters:
length The number of pushpins to assign. Valid values range from 0 to 4.
uvCoords The uv texture coordinates of each pushpin.
aaCoords The arbitrary axis point of each pushpin.
projection_vector The projection vector of the texture. A projection vector of 0.0, 0.0, 0.0 indicates that a projection vector is not used. If this face is not valid, an empty vector is returned.
virtual void atlast::sketchup::ISketchUpFace::SetReversed ( bool  reverseIt = true  )  [pure virtual]

Directs the face to reverse its orientation.

Effectively reverses the normal of the face's plane.

Parameters:
reverseIt If true, the face is reversed. If false, the method is a no-op.

©2010 Google - Google Home - About Google