mesh (lx_mesh.hpp)

From The Foundry MODO SDK wiki
Jump to: navigation, search
There are security restrictions on this page


Contents

Mesh Service

The mesh service provides high-level mesh system access. These methods are provided as general services that could be useful on any mesh.

(1) SDK: Declarations
 #define LXa_MESHSERVICE "meshservice"
 #define LXu_MESHSERVICE "82B739EC-F92E-4CC9-A5FB-584A866D5897"

(2) SDK: ILxMeshService interface
         LXxMETHOD(  LxResult,
 ScriptQuery) (
         LXtObjectID              self,
         void                   **ppvObj);

Mark Modes

Mark modes are collections of bits of two types: the ones required to be set and ones required to be clear. To be specific, this is not simply turning a bit on or off; a bit can be required to be set or can be required to be clear based on the mark mode. The mesh service allows mark mode masks to be created and read via strings. The mode which matches anything (and changes nothing) is always just zero.

(3) SDK: Types
 typedef unsigned int    LXtMarkMode;
 #define LXiMARK_ANY     ((LXtMarkMode) 0)
 
 #define LXsMARK_HIDE    "hide"
 #define LXsMARK_HALO    "halo"
 #define LXsMARK_LOCK    "lock"
 #define LXsMARK_SELECT  "select"
 #define LXsMARK_USER_0  "user0"
 #define LXsMARK_USER_1  "user1"
 #define LXsMARK_USER_2  "user2"
 #define LXsMARK_USER_3  "user3"
 #define LXsMARK_USER_4  "user4"
 #define LXsMARK_USER_5  "user5"
 #define LXsMARK_USER_6  "user6"
 #define LXsMARK_USER_7  "user7"

This method allows multiple mode bits to be marked as "must be set" or "must be cleared". The two arguments take a space-delimited list of modes to set or clear, failing with LXe_NOTFOUND if the mode is unknown. Either argument can be NULL.

(4) SDK: ILxMeshService interface
         LXxMETHOD(  LxResult,
 ModeCompose) (
         LXtObjectID              self,
         const char              *set,
         const char              *clear,
         LXtMarkMode             *mode);

(5) SDK: ModeCompose Example
 // Get a mark mode which requires the "select" bit to be set
 rc = meshService[0]->ModeCompose (meshService, "select", NULL, &mode);
 
 // Require "user1" to be set and both "hide" and "lock" to be clear
 rc = meshService[0]->ModeCompose (meshService, "user1",  "hide lock", &mode);

The user class has a couple of methods to get modes that just set and clear.

(6) User Service Class: MeshService method
         LXtMarkMode
 SetMode (
         const char              *set)
 {
         LXtMarkMode              mode;
 
         ModeCompose (set, 0, &mode);
         return mode;
 }
 
         LXtMarkMode
 ClearMode (
         const char              *clr)
 {
         LXtMarkMode              mode;
 
         ModeCompose (0, clr, &mode);
         return mode;
 }

Vertex Map Types

Vertex map types have names and codes which can be translated with these functions.

(7) SDK: ILxMeshService interface
         LXxMETHOD(  LxResult,
 VMapLookupType) (
         LXtObjectID              self,
         const char              *name,
         LXtID4                  *type);
 
         LXxMETHOD(  LxResult,
 VMapLookupName) (
         LXtObjectID              self,
         LXtID4                   type,
         const char             **name);

It can also be useful to find the features of a vertex map type without requiring an actual instance. These functions are equivalent to the same-named functions in the mesh map interface.

(8) SDK: ILxMeshService interface
         LXxMETHOD(  LxResult,
 VMapDimension) (
         LXtObjectID              self,
         LXtID4                   type,
         unsigned int            *dimension);
 
         LXxMETHOD(  LxResult,
 VMapIsEdgeMap) (
         LXtObjectID              self,
         LXtID4                   type);
 
         LXxMETHOD(  LxResult,
 VMapIsContinuous) (
         LXtObjectID              self,
         LXtID4                   type);
 
         LXxMETHOD(  LxResult,
 VMapZeroDefault) (
         LXtObjectID              self,
         LXtID4                   type);

Client Meshes

Clients can create their own private mesh objects, not affiliated with any item.

(9) SDK: ILxMeshService interface
         LXxMETHOD(  LxResult,
 CreateMesh) (
         LXtObjectID              self,
         void                   **ppvObj);

(10) User Service Class: MeshService method
         bool
 NewMesh (
         CLxLoc_Mesh             &mesh)
 {
         return CreateMesh (mesh);
 }

This converts a private mesh to a static mesh.

(11) SDK: ILxMeshService interface
         LXxMETHOD(  LxResult,
 ConvertMesh) (
         LXtObjectID              self,
         LXtObjectID              triGroupObj,
         LXtObjectID              meshObj);

Some of the tool packets still use the obsolete LXtMeshID type. These functions allow you to convert between mesh IDs and mesh objects. These functions should be used carefully since they're not very safe. That's why the LXtMeshID was retired in the first place.

(12) SDK: ILxMeshService interface
         LXxMETHOD(  LxResult,
 MeshFromMeshID) (
         LXtObjectID              self,
         LXtMeshID                meshID,
         void                   **ppvObj);
 
         LXxMETHOD(  LXtMeshID,
 MeshToMeshID) (
         LXtObjectID              self,
         LXtObjectID              mesh);

Defined here and in lxmeshOLD, protected because of gcc whining.

(13) SDK: Types
 #ifndef   LX_DEF_LXTMESHID
   #define LX_DEF_LXTMESHID
   typedef struct st_Mesh *      LXtMeshID;
 #endif

Empty mesh service Python user class.

(14) PY: MeshService method
 pass

This converts any surface to a static mesh.

(15) SDK: ILxMeshService interface
         LXxMETHOD(  LxResult,
 SurfaceToTriGroup) (
         LXtObjectID              self,
         LXtObjectID              triGroupObj,
         LXtObjectID              surfObj);

This converts a static mesh to an editable mesh.

(16) SDK: ILxMeshService interface
         LXxMETHOD(  LxResult,
 MeshFromTriGroup) (
         LXtObjectID              self,
         LXtObjectID              meshObj,
         LXtObjectID              triGroupObj);

Static meshes can be rigidly transformed.

(17) SDK: ILxMeshService interface
         LXxMETHOD(  LxResult,
 TriGroupTransform) (
         LXtObjectID              self,
         LXtObjectID              triGroupObj,
         LXtMatrix4               xfrm);

Polygon Edit Services

Creates a ILxPolygonSlice object which slices polygons.

(18) SDK: ILxMeshService interface
         LXxMETHOD(  LxResult,
 CreateSlice) (
         LXtObjectID              self,
         void                   **ppvObj);

Creates a ILxSolidDrill object which slices polygons.

(19) SDK: ILxMeshService interface
         LXxMETHOD(  LxResult,
 CreateSolidDrill) (
         LXtObjectID              self,
         void                   **ppvObj);

(20) User Service Class: MeshService method
         bool
 NewSolidDrill (
         CLxLoc_SolidDrill       &drill)
 {
         return CreateSolidDrill (drill);
 }

Nexus 10

This returns LXe_TRUE if the specified mesh item is procedural and LXe_FALSE if it isn't.

(21) SDK: ILxMeshService interface
         LXxMETHOD(  LxResult,
 IsMeshProcedural) (
         LXtObjectID              self,
         LXtObjectID              item);

Returns an Item object that a mesh belongs to. For private meshes, the function fails.

(22) SDK: ILxMeshService interface
         LXxMETHOD(  LxResult,
 ItemFromMesh) (
         LXtObjectID              self,
         LXtObjectID              mesh,
         void                   **ppvObj);

(23) User Service Class: MeshService method
         bool
 GetMeshItem (
         ILxUnknownID             mesh,
         CLxLoc_Item             &item)
 {
         LXtObjectID              obj = NULL;
 
         if (LXx_FAIL (ItemFromMesh (mesh, &obj)))
                 return false;
 
         return item.take (obj);
 }

Returns a curve group for the provided mesh, allowing the polygonal curves to be enumerated and evaluated.

(24) SDK: ILxMeshService interface
         LXxMETHOD(  LxResult,
 CurveGroupFromMesh) (
         LXtObjectID               self,
         LXtObjectID               mesh,
         const LXtMatrix4          xfrm,
         void                    **ppvObj);

Mesh Interface

The the ILxMesh object is the core interface for manipulating meshes. It is also responsible for spawning accessors, which provide access to the points, polygons, edges, and maps within the mesh. Multiple independent accessors can be spawned for each mesh.

(25) SDK: Declarations
 #define LXa_MESH        "mesh2"
 #define LXu_MESH        "A9E30646-D729-4850-B4C4-F00A5E93FE25"
 
 #define LXsTYPE_MESH    "mesh"

Points, polygons, edges and maps are referenced by these types. These are not COM objects, but are simply identifiers for specific elements which are then accessed through the accessors.

(26) SDK: Types
 typedef struct st_MeshVertex *    LXtPointID;
 typedef struct st_MeshPolygon *   LXtPolygonID;
 typedef struct st_MeshEdge *      LXtEdgeID;
 typedef struct st_MeshVertexMap * LXtMeshMapID;

Element Counts

These methods return the number of elements of their type in the mesh.

(27) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 PointCount) (
         LXtObjectID              self,
         unsigned int            *count);
 
         LXxMETHOD(  LxResult,
 PolygonCount) (
         LXtObjectID              self,
         unsigned int            *count);
 
         LXxMETHOD(  LxResult,
 EdgeCount) (
         LXtObjectID              self,
         unsigned int            *count);
 
         LXxMETHOD(  LxResult,
 MapCount) (
         LXtObjectID              self,
         unsigned int            *count);

User class variants gets the counts directly, with minimal checking.

(28) User Class: Mesh method
         int
 NPoints () const
 {
         unsigned         count;
 
         if (LXx_OK (PointCount (&count)))
                 return count;
         return -1;
 }
 
         int
 NPolygons () const
 {
         unsigned         count;
 
         if (LXx_OK (PolygonCount (&count)))
                 return count;
         return -1;
 }
 
         int
 NEdges () const
 {
         unsigned         count;
 
         if (LXx_OK (EdgeCount (&count)))
                 return count;
         return -1;
 }
 
         int
 NMaps () const
 {
         unsigned         count;
 
         if (LXx_OK (MapCount (&count)))
                 return count;
         return -1;
 }

Empty Mesh Python user class.

(29) PY: Mesh method
 pass

Mesh Properties

This method returns the bounding box of the mesh.

(30) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 BoundingBox) (
         LXtObjectID              self,
         LXtMarkMode              pick,
         LXtBBox                 *bbox);

This method returns the maximum number of polygons shared by any point in the mesh.

(31) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 MaxPointPolygons) (
         LXtObjectID              self,
         LXtMarkMode              pick,
         unsigned int            *count);

This method returns the maximum size of any polygon marked in the mesh.

(32) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 MaxPolygonSize) (
         LXtObjectID              self,
         LXtMarkMode              pick,
         unsigned int            *count);

Sets the the value of the specified tag that will be applied to any newly created polys.

(33) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 PolyTagSetDefault) (
         LXtObjectID              self,
         LXtID4                   type,
         const char              *tag);

Allocating Accessors

Most data about a mesh is obtained through the accessors. These methods return new accessors, which must be released by the client when no longer needed. Multiple accessors can exist at the same time for the same mesh without conflicting. Accessors can be used to walk the list of elements in a mesh or to obtain specific information about a particular element.

These methods create and return the various accessors. Each one is unique to the caller can so can be used in parallel with others obtained from these methods.

(34) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 PointAccessor) (
         LXtObjectID              self,
         void                   **ppvObj);
 
         LXxMETHOD(  LxResult,
 PolygonAccessor) (
         LXtObjectID              self,
         void                   **ppvObj);
 
         LXxMETHOD(  LxResult,
 EdgeAccessor) (
         LXtObjectID              self,
         void                   **ppvObj);
 
         LXxMETHOD(  LxResult,
 MeshMapAccessor) (
         LXtObjectID              self,
         void                   **ppvObj);

(35) SDK: Declarations
 

User class methods allocate directly into the user classes for the accessors.

(36) User Class: Mesh method
         bool
 GetPoints (
         CLxLoc_Point            &acc)
 {
         return PointAccessor (acc);
 }
 
         bool
 GetPolygons (
         CLxLoc_Polygon          &acc)
 {
         return PolygonAccessor (acc);
 }
 
         bool
 GetEdges (
         CLxLoc_Edge             &acc)
 {
         return EdgeAccessor (acc);
 }
 
         bool
 GetMaps (
         CLxLoc_MeshMap          &acc)
 {
         return MeshMapAccessor (acc);
 }

If a mesh is accessed for write, any edits made have to be signalled back to the mesh.

(37) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 SetMeshEdits) (
         LXtObjectID              self,
         unsigned int             edits);

(38) SDK: Declarations

Polygon Type Attributes

Polygon types can have overall settings that affect all the polygons of that type in the mesh.

Set and get SUBD subdivision level for the mesh.

(39) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 SUBDGetLevel) (
         LXtObjectID              self,
         int                     *n);

(40) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 SUBDSetLevel) (
         LXtObjectID              self,
         int                      n);

Set and get SUBD UV interpolation flag.

(41) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 SUBDGetLinearUV) (
         LXtObjectID              self,
         int                     *isLinear);

(42) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 SUBDSetLinearUV) (
         LXtObjectID              self,
         int                      isLinear);

Set and get PSUB boundary rules. They are mapped to "smooth", "crease all" and "crease edges" in definitions of prman.

(43) SDK: Declarations

(44) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 PSUBGetBoundRule) (
         LXtObjectID              self,
         int                     *bound);

(45) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 PSUBSetBoundRule) (
         LXtObjectID              self,
         int                      bound);

601 Methods

Give a mesh interface and another mesh object, this returns true if they refer to the same actual mesh.

(46) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 TestSameMesh) (
         LXtObjectID              self,
         LXtObjectID              other);

(47) User Class: Mesh method
         bool
 IsSame (
         ILxUnknownID             other)
 {
         return (TestSameMesh (other) == LXe_TRUE);
 }

These methods separate contents of a PICK ptag into component selection sets, presenting a list of the distinct selection sets, rather than the large and redundant list of all distinct PICK poly tag values.

(48) SDK: ILxMesh interface
         LXxMETHOD(  unsigned,
 PTagCount) (
         LXtObjectID              self,
         LXtID4                   type);

(49) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 PTagByIndex) (
         LXtObjectID              self,
         LXtID4                   type,
         unsigned                 index,
         const char              **tag);

Catmull-Clark Methods

Set and get PSUB subdivision level for the mesh.

(50) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 PSUBGetLevel) (
         LXtObjectID              self,
         int                     *n);

(51) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 PSUBSetLevel) (
         LXtObjectID              self,
         int                      n);

Set and get PSUB subdivision level for the mesh.

(52) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 PSUBGetCurrentLevel) (
         LXtObjectID              self,
         int                     *n);

(53) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 PSUBSetCurrentLevel) (
         LXtObjectID              self,
         int                      n);

(54) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 PSUBSetSubdivObj) (
         LXtObjectID              self,
         LXtObjectID              subObj);

(55) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 ChangeEvent) (
         LXtObjectID              self,
         unsigned                 event);

Multi-Resolution layers

Multi-Resolution layers are new displacement data for 901. Displpacement vectors in layers are composited based on the opacity ratio.

This method returns number of multi-resolution layer.

(56) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 PSUBDispNumLayer) (
         LXtObjectID              self,
         int                     *num);

This method returns name of multi-resolution layer for given layer index.

(57) SDK: ILxMesh interface
         LXxMETHOD(  const char *,
 PSUBDispLayerName) (
         LXtObjectID              self,
         int                      index);

This method look up multi-resolution layer by layer name and set the index and retruns OK if it is found.

(58) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 PSUBDispLayerLookupByName) (
         LXtObjectID              self,
         const char              *name,
         int                     *index);

This method returns the current selected multi-resolution layer. index.

(59) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 PSUBDispLayerCurrent) (
         LXtObjectID              self,
         int                     *index);

This method returns the enable state of multi-resolution layer for given layer index.

(60) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 PSUBDispLayerEnable) (
         LXtObjectID              self,
         int                      index,
         int                     *enable);

This method returns the opacity of multi-resolution layer for given layer index.

(61) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 PSUBDispLayerOpacity) (
         LXtObjectID              self,
         int                      index,
         double                  *opacity);

This method set the opacity of multi-resolution layer for given layer index. This is not undoable action.

(62) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 PSUBDispLayerSetOpacity) (
         LXtObjectID              self,
         int                      index,
         double                   opacity);

Nexus 10

If multiple operations need to be batched together, this function will start and end a mesh edit batch on the specified mesh.

(63) SDK: ILxMesh interface
         LXxMETHOD( LxResult,
 BeginEditBatch) (
         LXtObjectID              self);
 
         LXxMETHOD( LxResult,
 EndEditBatch) (
         LXtObjectID              self);

This merges the provided mesh with the current mesh, copying all the data from other.

(64) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 Merge) (
         LXtObjectID              self,
         LXtObjectID              other);

This removes all data in the current mesh.

(65) SDK: ILxMesh interface
         LXxMETHOD(  LxResult,
 Clear) (
         LXtObjectID              self);

Accessors

Common Accessor Methods

Each of the accessors have similar methods for walking their respective lists of elements, spawning new copies of the accessor, etc.

This method creates a new instance of the accessor. The initial state is the same as the original accessor, but it is completely independent and can be separately manipulated. This is useful if you want to keep this element's information around while you continue to manipulate the original accessor.

(66) Common Accessor Methods
         LXxMETHOD(  LxResult,
 Spawn) (
         LXtObjectID              self,
         void                   **ppvObj);

(67) SDK: Declarations
 

This method can be used to test an element's mark bits against a mark mode, returning LXe_TRUE if they match and LXe_FALSE if they don't.

(68) Common Geometry Accessor Methods
         LXxMETHOD(  LxResult,
 TestMarks) (
         LXtObjectID              self,
         LXtMarkMode              mode);

This method can be used to change the marks on an element. Bits set in the mode will be set, and bits clear in the mode will be cleared. All other bits will be unchanged. This does not require the mesh to be editable.

(69) Common Geometry Accessor Methods
         LXxMETHOD(  LxResult,
 SetMarks) (
         LXtObjectID              self,
         LXtMarkMode              set);

These are common user class methods that are common to the different enumerators. We have a constructor that can take a mesh user object and spawn the right type of accessor. Alternately we can set the interface from a raw mesh object. User class duplicate method makes a copy of this accessor using Spawn() into the user class of the same type.

(70) Common $$ User Methods
 CLxUser_$$ (
         CLxLoc_Mesh             &mesh)
 {
         _init ();
         fromMesh (mesh);
 }
 
         bool
 fromMesh (
         CLxLoc_Mesh             &mesh)
 {
         LXtObjectID              acc;
 
         clear ();
         if (mesh.test () && LXx_OK (mesh.$$Accessor (&acc)))
                 return take (acc);
 
         return false;
 }
 
         bool
 fromMeshObj (
         ILxUnknownID             obj)
 {
         CLxLoc_Mesh              mesh (obj);
         LXtObjectID              acc;
 
         clear ();
         if (mesh.test () && LXx_OK (mesh.$$Accessor (&acc)))
                 return take (acc);
 
         return false;
 }
 
         bool
 duplicate (
         CLxLoc_$$               &acc)
 {
         LXtObjectID              obj;
 
         acc.clear ();
         if (LXx_FAIL (Spawn (&obj)))
                 return false;
 
         return acc.take (obj);
 }

The C++ version of the test method returns a native boolean.

(71) Common Marking User Methods
         bool
 Test (
         LXtMarkMode              mode)
 {
         return (TestMarks (mode) == LXe_TRUE);
 }

Enumeration

The fastest method of traversing the mesh is an enumeration. The mode selects which subset of elements to traverse. The visitor will be called with the accessor set to each successive element. The optional monitor allows the caller to track the progress of the enumeration.

If the visitor returns an error code, the enumeration will be aborted and that code will be returned directly from Enumerate().

For example, the return code LXe_FALSE can be returned by the visitor to exit early.

Note that the monitor will itself return LXe_ABORT should the user manually abort the operation by clicking the abort button.

(72) Common Accessor Methods
         LXxMETHOD(  LxResult,
 Enumerate) (
         LXtObjectID              self,
         LXtMarkMode              mode,
         LXtObjectID              visitor,
         LXtObjectID              monitor);

C++ Enumeration is done by the user passing in a visitor. We create a generic visitor as a COM object on the stack and pass that to the real enumeration method. Our generic visitor will then call the user's real abstract visitor's Evaluate() method. The LxResult is returned because the enumeration can terminate on different error codes from the user.

(73) Common Enumerator User Methods
         LxResult
 Enum (
         CLxImpl_AbstractVisitor *visitor,
         LXtMarkMode              mode = LXiMARK_ANY,
         ILxUnknownID             mon  = 0)
 {
         CLxInst_OneVisitor<CLxGenericVisitor>  gv;
 
         gv.loc.vis = visitor;
         return Enumerate (mode, gv, mon);
 }

Point Accessor

The ILxPoint is a combination of an accessor for specific points, as well as providing a mechanism to walk the mesh's point list.

(74) SDK: Declarations
 #define LXa_POINT       "point"
 #define LXu_POINT       "37B477FE-ED3C-4EDC-A4A8-9BB24F58A4E6"

As mentioned previously, all accessors share common interface methods for walking their respective lists.

(75) SDK: ILxPoint interface
 ''[[#C66|Common Accessor Methods]]''
 ''[[#C68|Common Geometry Accessor Methods]]''

(76) User Class: Point method
 ''[[#C70|Common Point User Methods]]''
 ''[[#C71|Common Marking User Methods]]''
 ''[[#C73|Common Enumerator User Methods]]''

Selecting a Point to Access

This method sets the accessor to the given point. Only points that are known to be in the mesh should be passed to this method.

(77) SDK: ILxPoint interface
         LXxMETHOD(  LxResult,
 Select) (
         LXtObjectID              self,
         LXtPointID               point);

A point can be selected by its index in the mesh.

(78) SDK: ILxPoint interface
         LXxMETHOD(  LxResult,
 SelectByIndex) (
         LXtObjectID              self,
         unsigned int             index);

A point can also be selected by its index within a polygon.

(79) SDK: ILxPoint interface
         LXxMETHOD(  LxResult,
 SelectPolygonVertex) (
         LXtObjectID              self,
         LXtPolygonID             polygon,
         unsigned int             index);

Point Properties

This methods returns the ID of the curent point or null if none.

(80) SDK: ILxPoint interface
         LXxMETHOD( LXtPointID,
 ID) (
         LXtObjectID              self);

This methods returns the index of the curent point.

(81) SDK: ILxPoint interface
         LXxMETHOD( LxResult,
 Index) (
         LXtObjectID              self,
         unsigned int            *index);

This returns the position of the point.

(82) SDK: ILxPoint interface

This method returns the geometric normal of this point for the given polygon. This is the average of the connected polyon normals if the polygon is null.

(83) SDK: ILxPoint interface
         LXxMETHOD(  LxResult,
 Normal) (
         LXtObjectID              self,
         LXtPolygonID             pol,
         LXtVector                normal);

This returns the value of the current point in the given map. This returns LXe_FALSE for points with no value set in the map.

(84) SDK: ILxPoint interface
         LXxMETHOD(  LxResult,
 MapValue) (
         LXtObjectID              self,
         LXtMeshMapID             map,
         float                   *value);

This method is the same as MapValue(), except that if the point is not in the map it will return zero for maps that allow that.

(85) SDK: ILxPoint interface
         LXxMETHOD(  LxResult,
 MapEvaluate) (
         LXtObjectID              self,
         LXtMeshMapID             map,
         float                   *value);

These methods return the number of polygons sharing this point as a vertex, and get the polygon ID for a specific index.

(86) SDK: ILxPoint interface
         LXxMETHOD(  LxResult,
 PolygonCount) (
         LXtObjectID              self,
         unsigned int            *count);
 
         LXxMETHOD(  LxResult,
 PolygonByIndex) (
         LXtObjectID              self,
         unsigned int             index,
         LXtPolygonID            *polygonID);

Edit Operations

This creates a new point in the mesh. It sets the current point to the new point.

(87) SDK: ILxPoint interface
         LXxMETHOD(  LxResult,
 New) (
         LXtObjectID              self,
         const LXtVector          pos,
         LXtPointID              *pointID);

This creates a new point in the mesh duplicating the current point. If this point has already been copied this function returns the same pointer.

(88) SDK: ILxPoint interface
         LXxMETHOD(  LxResult,
 Copy) (
         LXtObjectID              self,
         LXtPointID              *pointID);

This removes a point from the mesh. Any polygons that use this point should already have been altered to remove the point from their vertex list. Maps are automatically updated to reflect the removed point.

(89) SDK: ILxPoint interface
         LXxMETHOD(  LxResult,
 Remove) (
         LXtObjectID              self);

This sets a point's position.

(90) SDK: ILxPoint interface
         LXxMETHOD(  LxResult,
 SetPos) (
         LXtObjectID              self,
         const LXtVector          pos);

This sets the value for the point in the given map.

(91) SDK: ILxPoint interface
         LXxMETHOD(  LxResult,
 SetMapValue) (
         LXtObjectID              self,
         LXtMeshMapID             map,
         const float             *value);

This removes any value for the point in the given map.

(92) SDK: ILxPoint interface
         LXxMETHOD(  LxResult,
 ClearMapValue) (
         LXtObjectID              self,
         LXtMeshMapID             map);

Patch Operations

The corner control point for a vertex can also be accessed. This is the location of the actual intersection of the patch mesh.

(93) SDK: ILxPoint interface
         LXxMETHOD(  LxResult,
 Corner) (
         LXtObjectID              self,
         LXtFVector               pos);

Interconnection

These methods return the number of points connecting this point as a point, and get the point ID for a specific index.

(94) SDK: ILxPoint interface
         LXxMETHOD(  LxResult,
 PointCount) (
         LXtObjectID              self,
         unsigned int            *count);

(95) SDK: ILxPoint interface
         LXxMETHOD(  LxResult,
 PointByIndex) (
         LXtObjectID              self,
         unsigned int             index,
         LXtPointID              *pointID);

These methods return the number of edges connecting this point as a point, and get the edge ID for a specific index.

(96) SDK: ILxPoint interface
         LXxMETHOD(  LxResult,
 EdgeCount) (
         LXtObjectID              self,
         unsigned int            *count);

(97) SDK: ILxPoint interface
         LXxMETHOD(  LxResult,
 EdgeByIndex) (
         LXtObjectID              self,
         unsigned int             index,
         LXtEdgeID               *edgeID);

Symmetry

This sets the symmetric point corresponding to the current point when the symmetry mode is enabled. This returns LXe_OK when the symmetric point is found, otherwise it returns LXe_FAILED. When the current point is on the symmetry center plane, it returns LXe_FAILED.

(98) SDK: ILxPoint interface
         LXxMETHOD(  LxResult,
 Symmetry) (
         LXtObjectID              self,
         LXtPointID              *pointID);

This returns LXe_TRUE if the symmetry state is enabled and the current point is on the symmetry center plane, otherwise it returns LXe_FALSE.

(99) SDK: ILxPoint interface
         LXxMETHOD(  LxResult,
 OnSymmetryCenter) (
         LXtObjectID              self);

Empty Point Python user class.

(100) PY: Point method
 pass

Polygon Accessor

The ILxPolygon is used to obtain information about specific polygons, as well as allowing the list of polygons to be walked.

(101) SDK: Declarations
 #define LXa_POLYGON     "polygon2"
 #define LXu_POLYGON     "DD64141D-DC92-4348-B45B-F73FC64F1E52"

As mentioned previously, all accessors share common interface methods for walking their respective lists.

(102) SDK: ILxPolygon interface
 ''[[#C66|Common Accessor Methods]]''
 ''[[#C68|Common Geometry Accessor Methods]]''

(103) User Class: Polygon method
 ''[[#C70|Common Polygon User Methods]]''
 ''[[#C71|Common Marking User Methods]]''
 ''[[#C73|Common Enumerator User Methods]]''

Selecting a Polygon to Access

This method sets the accessor to the given polygon.

(104) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 Select) (
         LXtObjectID              self,
         LXtPolygonID             polygon);

(105) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 SelectByIndex) (
         LXtObjectID              self,
         unsigned int             index);

Polygon Properties

This method returns the ID of the current polygon.

(106) SDK: ILxPolygon interface
         LXxMETHOD( LXtPolygonID,
 ID) (
         LXtObjectID              self);

This methods returns the index of the curent polygon.

(107) SDK: ILxPolygon interface
         LXxMETHOD( LxResult,
 Index) (
         LXtObjectID              self,
         int                     *index);

This returns the type of the polygon.

(108) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 Type) (
         LXtObjectID              self,
         LXtID4                  *type);

These return the number of vertices in the polygon, and get the point ID's by index.

(109) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 VertexCount) (
         LXtObjectID              self,
         unsigned int            *count);
 
         LXxMETHOD(  LxResult,
 VertexByIndex) (
         LXtObjectID              self,
         unsigned int             index,
         LXtPointID              *point);

There are two special polygon flags, which are used by curves. The first method returns LXe_TRUE if the first point on is an extended control point, while the second returns true if the last point is a control point. If the polygon is not a curve, this method fails.

(110) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 FirstIsControlEndpoint) (
         LXtObjectID              self);
 
         LXxMETHOD(  LxResult,
 LastIsControlEndpoint) (
         LXtObjectID              self);

This method returns the geometric normal of this polygon. This fails if there is no normal or the polygon has only one or two points. The normal is the same as the normal for the triangle containing the first point.

(111) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 Normal) (
         LXtObjectID              self,
         LXtVector                normal);

This method gets the map value of a specific point in this polygon given a map. It returns LXe_FALSE if the specific is unmapped.

(112) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 MapValue) (
         LXtObjectID              self,
         LXtMeshMapID             map,
         LXtPointID               point,
         float                   *value);

Evaluating the map first tries to find a discontinuous value specific to this polygon. If there is none it falls back on the continuous value for the point itself. Failing that it may return zero for a map that allows that.

(113) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 MapEvaluate) (
         LXtObjectID              self,
         LXtMeshMapID             map,
         LXtPointID               point,
         float                   *value);

This function returns the approximate surface area of the current polygon.

(114) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 Area) (
         LXtObjectID              self,
         double                  *area);

Editing Operations

This method creates a new polygon of the given type from a prepared list of point IDs. If 'rev' is true, the point list will be used in reverse.

(115) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 New) (
         LXtObjectID              self,
         LXtID4                   type,
         const LXtPointID        *vertices,
         unsigned int             numVert,
         unsigned int             rev,
         LXtPolygonID            *polygonID);

This method is the same as New(), but it copies the tags from the current polygon which is used as a prototype. Type can also be zero to copy the polygon type from the prototype.

(116) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 NewProto) (
         LXtObjectID              self,
         LXtID4                   type,
         const LXtPointID        *vertices,
         unsigned int             numVert,
         unsigned int             rev,
         LXtPolygonID            *polygonID);

This removes a polygon from the mesh.

(117) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 Remove) (
         LXtObjectID              self);

These set if the first or last endpoints of a curve are control points, failing if this is not a curve-type polygon.

(118) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 SetFirstIsControlEndpoint) (
         LXtObjectID              self,
         int                      state);
 
         LXxMETHOD(  LxResult,
 SetLastIsControlEndpoint) (
         LXtObjectID              self,
         int                      state);

This method allows the vertex list of a polygon to be changed.

(119) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 SetVertexList) (
         LXtObjectID              self,
         const LXtPointID        *vertices,
         unsigned int             numVert,
         unsigned int             rev);

This sets the value in the given point map for a point/polygon pair. The number of elements in the 'value' array should match the dimension of the map.

(120) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 SetMapValue) (
         LXtObjectID              self,
         LXtPointID               point,
         LXtMeshMapID             map,
         const float             *value);

This removes any value for the point/polygon pair in the given map.

(121) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 ClearMapValue) (
         LXtObjectID              self,
         LXtPointID               point,
         LXtMeshMapID             map);

A polygon has 16 bits for its point count, so it can have a large but limited number of vertices. Zero is never really valid but is nonetheless possible.

(122) SDK: Declarations
 #define LXi_POLY_MAXVERT         65535

Create from Contour

Polygons can also be created from a contour. A contour defines a path that can consist of multiple closed loops with reversed loops inside that act as holes. this call starts a contour.

(123) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 StartContour) (
         LXtObjectID              self);

This call adds an edge to the contour. Edges must form a set of closed loops.

(124) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 AddContourEdge) (
         LXtObjectID              self,
         LXtPointID               startPt,
         LXtPointID               endPt);

When all the contour edges are added, this adds a set of polygons describing the same surface as the closed contour. Since multiple polygons may be added this only returns the new polygon ID if there was only one. Multiple polygons must be inferred some other way.

(125) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 GenerateContour) (
         LXtObjectID              self,
         LXtID4                   type,
         LXtPolygonID            *polygonID);

This is the same but uses the current polygon as prototype for all the new polygons to be created from the contour.

(126) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 GenerateContourProto) (
         LXtObjectID              self,
         LXtPolygonID            *polygonID);

Raycasting Polygons

This method traces a ray with a given start position and direction (normalized). If the ray intersects a polygon it sets the current polygon, sets the distance to the hit point and the surface normal, and returns LXe_TRUE. It returns LXe_FALSE if there are no polygons in the path of the ray.

(127) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 IntersectRay) (
         LXtObjectID              self,
         const LXtVector          pos,
         const LXtVector          dir,
         LXtVector                hitNorm,
         double                  *hitDist);

This method finds the closest polygon from the given position. If it finds a polygon, it sets the current polygon, the hit position, the distance to the hit position and the surface normal, and returns LXe_TRUE. It returns LXe_FALSE if there are no polygons. If 'maxDist' is set, the method finds polygons in the radius given by 'maxDist' from the given position.

(128) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 Closest) (
         LXtObjectID              self,
         double                   maxDist,
         const LXtVector          pos,
         LXtVector                hitPos,
         LXtVector                hitNorm,
         double                  *hitDist);

Polygon Properties

This returns the index of the point on the polygon. It return -1 if the given point is not belong to the polygon.

(129) SDK: ILxPolygon interface
         LXxMETHOD( LxResult,
 PointIndex) (
         LXtObjectID              self,
         LXtPointID               pointID,
         unsigned int            *index);

This returns the index of the edge on the polygon. It return -1 if the given edge is not belong to the polygon.

(130) SDK: ILxPolygon interface
         LXxMETHOD( LxResult,
 EdgeIndex) (
         LXtObjectID              self,
         LXtEdgeID                edgeID,
         unsigned int            *index);

Returns the edge that is shared by both edges.

(131) SDK: ILxPolygon interface
         LXxMETHOD( LxResult,
 SharedEdge) (
         LXtObjectID              self,
         LXtPolygonID             polygonID,
         LXtEdgeID               *edgeID);

This returns LXe_TRUE if the polygon is on border or the polygon type is not surface.

(132) SDK: ILxPolygon interface
         LXxMETHOD( LxResult,
 IsBorder) (
         LXtObjectID              self);

Find a representative position for a polygon. This returns a position that is on the interior or the polygon but not on an edge.

(133) SDK: ILxPolygon interface
         LXxMETHOD( LxResult,
 RepresentativePosition) (
         LXtObjectID              self,
         LXtVector                pos);

Find a representative position for point list. This returns an index that is on the interior or the point list but not on an edge.

(134) SDK: ILxPolygon interface
         LXxMETHOD( LxResult,
 GoodPoint) (
         LXtObjectID              self,
         const LXtPointID        *points,
         unsigned int             nPoints,
         unsigned int            *index);

Triangulation

These functions provide a way to triagulate surface type polygons.

'GenerateTriangles' generates triangle lists and it returns the number of triangle to 'count'. If the current polygon is not a surface type, it returns FAILED.

(135) SDK: ILxPolygon interface
         LXxMETHOD( LxResult,
 GenerateTriangles) (
         LXtObjectID              self,
         unsigned int            *count);

This function returns three points consist of the triangle given by the index. 'GenerateTriangles' must be called to generate triangle list before calling this function.

(136) SDK: ILxPolygon interface
         LXxMETHOD( LxResult,
 TriangleByIndex) (
         LXtObjectID              self,
         unsigned                 index,
         LXtPointID              *point0,
         LXtPointID              *point1,
         LXtPointID              *point2);

This clears the internal triangle list.

(137) SDK: ILxPolygon interface
         LXxMETHOD( LxResult,
 ClearTriangles) (
         LXtObjectID              self);

Box and Ray Enumeration

Enumerate polygons using test conditions. The mode selects which subset of elements to traverse. The visitor will be called with the accessor set to each successive element.

This function enumerates the polygons conatined in the given bounding box.

(138) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 EnumerateBBox) (
         LXtObjectID              self,
         LXtMarkMode              mode,
         LXtObjectID              visitor,
         const LXtVector          min,
         const LXtVector          max);

This function enumerates the polygons along the ray given by its origin and direction vectors.

(139) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 EnumerateRay) (
         LXtObjectID              self,
         LXtMarkMode              mode,
         LXtObjectID              visitor,
         const LXtVector          org,
         const LXtVector          ray);

This function enumerates the polygons along the line given by its origin and direction vectors.

(140) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 EnumerateLine) (
         LXtObjectID              self,
         LXtMarkMode              mode,
         LXtObjectID              visitor,
         const LXtVector          org,
         const LXtVector          dir);

Curve Fill polygon

Create curve fill polygon from continuous linear type polygons.

(141) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 NewCurveFill) (
         LXtObjectID              self,
         const LXtPolygonID      *polygons,
         unsigned int             numPols,
         LXtPolygonID            *polygonID);

Symmetry

This sets the symmetric point corresponding to the current polygon when the symmetry mode is enabled. This returns LXe_OK when the symmetric polygon is found, otherwise it returns LXe_FAILED.

(142) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 Symmetry) (
         LXtObjectID              self,
         LXtPolygonID            *polygonID);

Empty Polygon Python user class.

(143) PY: Polygon method
 pass

UV Lookup

This returns surface point, normal, DPDU and DPDV for a given UV position on the polygon. The normal and the DPDU/DPDV can be null, if not interested in those values.

(144) SDK: ILxPolygon interface
         LXxMETHOD( LxResult,
 UVLookup) (
         LXtObjectID              self,
         const char              *vMapName,
         const LXtVector2         uv,
         LXtVector                surfacePosition,
         LXtVector                surfaceNormal,
         LXtVector                surfaceDPDU,
         LXtVector                surfaceDPDV);

The quality of the UV tracking depends on this enum.

(145) SDK: Declarations
 #define LXsPQ_POLY              0
 #define LXsPQ_SUBD              1

This function enumerates the polygons that contain the given texture coordinate position.

(146) SDK: ILxPolygon interface
         LXxMETHOD(  LxResult,
 EnumerateByUV) (
         LXtObjectID              self,
         LXtMarkMode              mode,
         const char              *vMapName,
         int                      quality,
         const LXtVector2         uv,
         LXtObjectID              visitor);

Types

The polygon type is given by a character string identifier which allows for extensible polygon types. A "face" polygon is just the facet defined by the vertices. A "curve" polygon is a Modeler-style spline curve.

(147) SDK: Declarations
 #define LXsPTYP_FACE            "face"
 #define LXsPTYP_CURVE           "curve"
 #define LXsPTYP_BEZIER          "bezier"
 #define LXsPTYP_SUBD            "subdiv"
 #define LXsPTYP_SPCH            "spatch"
 #define LXsPTYP_TEXT            "text"
 #define LXsPTYP_PSUB            "psubdiv"
 #define LXsPTYP_LINE            "line"
 #define LXsPTYP_CRVFIL          "curveFill"
 #define LXsPTYP_BSPLINE         "BSpline"

The second method is as a numeric ID code which is much faster when the type is known. There are ways to look up the one from the other.

(148) SDK: Declarations
 #define LXiPTYP_FACE            LXxID4('F','A','C','E')
 #define LXiPTYP_CURVE           LXxID4('C','U','R','V')
 #define LXiPTYP_BEZIER          LXxID4('B','E','Z','R')
 #define LXiPTYP_SUBD            LXxID4('S','U','B','D')
 #define LXiPTYP_SPCH            LXxID4('S','P','C','H')
 #define LXiPTYP_TEXT            LXxID4('T','E','X','T')
 #define LXiPTYP_PSUB            LXxID4('P','S','U','B')
 #define LXiPTYP_LINE            LXxID4('L','I','N','E')
 #define LXiPTYP_CRVFIL          LXxID4('C','F','I','L')
 #define LXiPTYP_BSPLINE         LXxID4('B','S','P','L')
 #define LXiPTYP_BEZR            LXiPTYP_BEZIER
 #define LXiPTYP_CURV            LXiPTYP_CURVE
 #define LXiPTYP_BSPL            LXiPTYP_BSPLINE

Polygon Tags

Polygons have tags which can be accessed using the ILxStringTag interface on the polygon accessor.

Polygon tag types can be arbitrary, so clients and even plugins are free to invent any type with any meaning they need for a specific application. However, having some predefined common types makes some of the basic applications more obvious.

MATR
The material name for a polygon is stored in a tag of this type. If the polygon has no material, some suitable default should be used.
PART
This tag is the name of the abstract element to which this polygon belongs. It is used primarily for selection during modeling.
PICK
This tag indicates the selection sets that this polygon belongs to. The name of the sets are separated by semicolons, for example if a polygon belongs to A and B its pick tag will be: "A;B"

These three polygon tags are for text polygon type.

FONT
This tag indicates the font name for this text polygon.
TEXT
This tag includes the text string for this text polygon.
JUST
This tag indicates the justification for this text polygon.The first character takes 'T'(Top), 'M'(Middle) and 'B'(Bottom). The second character takes 'L'(Left), 'C'(Center), and 'R'(Right). For example, 'BL' indicates the justification is bottom-left.

(149) SDK: Declarations
 #define LXi_POLYTAG_MATERIAL            LXxID4('M','A','T','R')
 #define LXi_POLYTAG_PART                LXxID4('P','A','R','T')
 #define LXi_POLYTAG_SMOOTHING_GROUP     LXxID4('S','M','G','P')
 #define LXi_POLYTAG_PICK                LXxID4('P','I','C','K')
 #define LXi_POLYTAG_FONT                LXxID4('F','O','N','T')
 #define LXi_POLYTAG_TEXT                LXxID4('T','E','X','T')
 #define LXi_POLYTAG_JUST                LXxID4('J','U','S','T')
 
 #define LXi_PTAG_MATR           LXxID4('M','A','T','R')
 #define LXi_PTAG_PART           LXxID4('P','A','R','T')
 #define LXi_PTAG_PICK           LXxID4('P','I','C','K')
 #define LXi_PTAG_FONT           LXxID4('F','O','N','T')
 #define LXi_PTAG_TEXT           LXxID4('T','E','X','T')
 #define LXi_PTAG_JUST           LXxID4('J','U','S','T')

Edge Accessor

The ILxEdge is used to obtain information about specific edges, as well as allowing the list of edges to be walked.

(150) SDK: Declarations
 #define LXa_EDGE        "edge"
 #define LXu_EDGE        "19A44432-E2CF-4BCF-9EA6-D696E7A0F16E"

As mentioned previously, all accessors share common interface methods for walking their respective lists.

(151) SDK: ILxEdge interface
 ''[[#C66|Common Accessor Methods]]''
 ''[[#C68|Common Geometry Accessor Methods]]''

(152) User Class: Edge method
 ''[[#C70|Common Edge User Methods]]''
 ''[[#C71|Common Marking User Methods]]''
 ''[[#C73|Common Enumerator User Methods]]''

This method sets the accessor to the given edge. Edge IDs are somewhat dynamic based on the points and polygons in the mesh, so an old edge ID should not be assumed valid if the mesh has been edited.

(153) SDK: ILxEdge interface
         LXxMETHOD(  LxResult,
 Select) (
         LXtObjectID              self,
         LXtEdgeID                edge);

This selects the edge by its endpoints.

(154) SDK: ILxEdge interface
         LXxMETHOD(  LxResult,
 SelectEndpoints) (
         LXtObjectID              self,
         LXtPointID               v0,
         LXtPointID               v1);

These methods returns the current edge ID.

(155) SDK: ILxEdge interface
         LXxMETHOD(  LXtEdgeID,
 ID) (
         LXtObjectID              self);

Edge Properties

This method returns the points that make up the edge. Either argument can be NULL if you only want one or the other.

(156) SDK: ILxEdge interface
         LXxMETHOD(  LxResult,
 Endpoints) (
         LXtObjectID              self,
         LXtPointID              *point0,
         LXtPointID              *point1);

This method returns the value of the edge in the map provided, returning LXe_FALSE if the edge is unmapped.

(157) SDK: ILxEdge interface
         LXxMETHOD(  LxResult,
 MapValue) (
         LXtObjectID              self,
         LXtMeshMapID             map,
         float                   *value);

(158) SDK: ILxEdge interface
         LXxMETHOD(  LxResult,
 MapEvaluate) (
         LXtObjectID              self,
         LXtMeshMapID             map,
         float                   *value);

Editing Operations

This sets the edge's value in the given point map.

(159) SDK: ILxEdge interface
         LXxMETHOD(  LxResult,
 SetMapValue) (
         LXtObjectID              self,
         LXtMeshMapID             map,
         const float             *value);

This removes any value for the edge pair in the given map.

(160) SDK: ILxEdge interface
         LXxMETHOD(  LxResult,
 ClearMapValue) (
         LXtObjectID              self,
         LXtMeshMapID             map);

Edge Properties

These methods return the number of polygons sharing this edge.

(161) SDK: ILxEdge interface
         LXxMETHOD(  LxResult,
 PolygonCount) (
         LXtObjectID              self,
         unsigned int            *count);

This returns the polygon given by its index.

(162) SDK: ILxEdge interface
         LXxMETHOD(  LxResult,
 PolygonByIndex) (
         LXtObjectID              self,
         unsigned int             index,
         LXtPolygonID            *polygonID);

This returns a polygon that is visible and surface. It also return the index of the polygon in the polygon list of the edge.

(163) SDK: ILxEdge interface
         LXxMETHOD(  LxResult,
 RepresentativePolygon) (
         LXtObjectID              self,
         LXtPolygonID            *polygonID,
         unsigned int            *index);

This returns a shared polygon between two edges.

(164) SDK: ILxEdge interface
         LXxMETHOD(  LxResult,
 SharedPolygon) (
         LXtObjectID              self,
         LXtEdgeID                edgeID,
         LXtPolygonID            *polygonID);

This returns LXe_TRUE if the edge is on border and it is belong to one polygon.

(165) SDK: ILxEdge interface
         LXxMETHOD(  LxResult,
 IsBorder) (
         LXtObjectID              self);

Symmetry

This sets the symmetric point corresponding to the current edge when the symmetry mode is enabled. This returns LXe_OK when the symmetric edge is found, otherwise it returns LXe_FAILED. When the current edge is on the symmetry center plane, it returns LXe_FAILED.

(166) SDK: ILxEdge interface
         LXxMETHOD(  LxResult,
 Symmetry) (
         LXtObjectID              self,
         LXtEdgeID               *edgeID);

This returns LXe_TRUE if the symmetry state is enabled and the current edge is on the symmetry center plane, otherwise it returns LXe_FALSE.

(167) SDK: ILxEdge interface
         LXxMETHOD(  LxResult,
 OnSymmetryCenter) (
         LXtObjectID              self);

Nexus 10

This methods returns the index of the curent edge.

(168) SDK: ILxEdge interface
         LXxMETHOD( LxResult,
 Index) (
         LXtObjectID              self,
         unsigned int            *index);

An edge can be selected by it's index. As edges don't have a deterministic index, this is calculated by iterating through the mesh polygon's edges and returning the index of the first occurance.

(169) SDK: ILxEdge interface
         LXxMETHOD(  LxResult,
 SelectByIndex) (
          LXtObjectID             self,
          unsigned int            index);

Empty Edge Python user class.

(170) PY: Edge method
 pass

Map Accessor

The ILxMeshMap is used to obtain information about specific point maps, as well as allowing the list of maps to be walked.

(171) SDK: Declarations
 #define LXa_MESHMAP     "meshmap"
 #define LXu_MESHMAP     "2AEBA454-2AC4-4F1E-B892-7A16F7601030"

As mentioned previously, all accessors share common interface methods for walking their respective lists.

(172) SDK: ILxMeshMap interface
 ''[[#C66|Common Accessor Methods]]''

(173) User Class: MeshMap method
 ''[[#C70|Common MeshMap User Methods]]''
 ''[[#C73|Common Enumerator User Methods]]''

This method sets the accessor to the given point map.

(174) SDK: ILxMeshMap interface
         LXxMETHOD(  LxResult,
 Select) (
         LXtObjectID              self,
         LXtMeshMapID             map);

This can be used to select a map by type and name.

(175) SDK: ILxMeshMap interface
         LXxMETHOD(  LxResult,
 SelectByName) (
         LXtObjectID              self,
         LXtID4                   type,
         const char              *name);

Maps can also be filtered by type which affects their enumeration. Passing a type of zero clears the filter.

(176) SDK: ILxMeshMap interface
         LXxMETHOD( LxResult,
 FilterByType) (
         LXtObjectID              self,
         LXtID4                   type);

Map Properties

This method returns the ID of the current map.

(177) SDK: ILxMeshMap interface
         LXxMETHOD( LXtMeshMapID,
 ID) (
         LXtObjectID              self);

These return the map's name and type.

(178) SDK: ILxMeshMap interface
         LXxMETHOD( LxResult,
 Name) (
         LXtObjectID              self,
         const char             **name);

(179) SDK: ILxMeshMap interface
         LXxMETHOD( LxResult,
 Type) (
         LXtObjectID              self,
         LXtID4                  *type);

This method returns the dimension of the current map.

(180) SDK: ILxMeshMap interface
         LXxMETHOD(  LxResult,
 Dimension) (
         LXtObjectID              self,
         unsigned int            *dimension);

This returns LXe_TRUE if this is an edge map.

(181) SDK: ILxMeshMap interface
         LXxMETHOD(  LxResult,
 IsEdgeMap) (
         LXtObjectID              self);

This returns LXe_TRUE if it is a continuous (vs. a discontinuous) map.

(182) SDK: ILxMeshMap interface
         LXxMETHOD(  LxResult,
 IsContinuous) (
         LXtObjectID              self);

This returns LXe_TRUE if the default value of elements not in the map should be zero.

(183) SDK: ILxMeshMap interface
         LXxMETHOD(  LxResult,
 ZeroDefault) (
         LXtObjectID              self);

Editing Operations

(184) SDK: ILxMeshMap interface
         LXxMETHOD(  LxResult,
 New) (
         LXtObjectID              self,
         LXtID4                   type,
         const char              *name,
         LXtMeshMapID            *mapID);

(185) SDK: ILxMeshMap interface
         LXxMETHOD(  LxResult,
 Remove) (
         LXtObjectID              self);

(186) SDK: ILxMeshMap interface
         LXxMETHOD(  LxResult,
 Clear) (
         LXtObjectID              self);

Map Traversal

It's possible for the client to enumerate just the elements that are members of the map. This function enumerates continuous values, calling the visitor with the point accessor set to each point.

(187) SDK: ILxMeshMap interface
         LXxMETHOD(  LxResult,
 EnumerateContinuous) (
         LXtObjectID              self,
         LXtObjectID              visitor,
         LXtObjectID              point);

Discontinuous values are the same but require a point and a polygon.

(188) SDK: ILxMeshMap interface
         LXxMETHOD(  LxResult,
 EnumerateDiscontinuous) (
         LXtObjectID              self,
         LXtObjectID              visitor,
         LXtObjectID              point,
         LXtObjectID              poly);

Likewise edge map can also be enumerated with an associated edge accessor.

(189) SDK: ILxMeshMap interface
         LXxMETHOD(  LxResult,
 EnumerateEdges) (
         LXtObjectID              self,
         LXtObjectID              visitor,
         LXtObjectID              edge);

Nexus 901 SP3

This sets the map's name

(190) SDK: ILxMeshMap interface
         LXxMETHOD( LxResult,
 SetName) (
         LXtObjectID              self,
         const char              *name);

User methods all have the same name but different arguments. They also wrap the native C++ visitor in a layer of chocolatey COM goodness.

(191) User Class: MeshMap method
         LxResult
 EnumContents (
         CLxImpl_AbstractVisitor *visitor,
         CLxLoc_Point            &point)
 {
         CLxInst_OneVisitor<CLxGenericVisitor>  gv;
 
         gv.loc.vis = visitor;
         return EnumerateContinuous (gv, point);
 }
 
         LxResult
 EnumContents (
         CLxImpl_AbstractVisitor *visitor,
         CLxLoc_Point            &point,
         CLxLoc_Polygon          &poly)
 {
         CLxInst_OneVisitor<CLxGenericVisitor>  gv;
 
         gv.loc.vis = visitor;
         return EnumerateDiscontinuous (gv, point, poly);
 }
 
         LxResult
 EnumContents (
         CLxImpl_AbstractVisitor *visitor,
         CLxLoc_Edge             &edge)
 {
         CLxInst_OneVisitor<CLxGenericVisitor>  gv;
 
         gv.loc.vis = visitor;
         return EnumerateEdges (gv, edge);
 }

Empty MeshMap Python user class.

(192) PY: MeshMap method
 pass

Map Types

Map types can be arbitrary, so clients and even plugins are free to invent any type with any meaning they need for a specific application. However, having some predefined common types makes some of the basic applications more obvious. The dimension of the map is given in parenthesis.

OPOS(3)
Object-space position vectors. This is a required singleton map and must be defined for all points. If the map is undefined then the point has no base location in object space.
MORF(3)
Morph target displacement vectors. The position of a point in the morph target is the base position of the point plus the offset stored in the map. Unassigned points have an implicit displacement of zero.
SPOT(3)
Morph target position vectors. The position of a point in the morph target is given by an absolute vector in the map. Unassigned points have their position given by the base position.
NORM(3)
Surface normals. These can be continuous at each point for smooth meshes or discontinuous for angular shapes.
TXUV(2)
Texture coordinates with an implicit range of 0.0 to 1.0. Values outside that range are folded back into the unit range when used. Unassigned points have no coordinates and no texturing is done for them.
WGHT(1)
General point weights. Although these can have any value, they should map into the nominal range of 0.0 to 1.0, or -1.0 to 1.0. Typically unassigned points are treated as if they have a weight of zero, so the zero value should be considered the default. These weights can also have any meaning, and may be applied to modulate shading, deformation or animation.
PICK(0)
Point selection sets. Since they have dimension zero, there is no actual data associated with the points. If the point has a value in the map that indicates membership in the selection set.
EPCK(0)
Edge selection sets. Since they have dimension zero, there is no actual data associated with the edges. If the edge has a value in the map that indicates membership in the selection set.
RGB (3)
Point color information, stored as red, green and blue in the range of 0.0 to 1.0.
RGBA(4)
Point color with transparency, stored as red, green, blue and alpha.
SUBV(1)
SubPatch point weights in the range of -1.0 to 1.0. Unassigned points have the default zero weight.
VECT(3)
Vector expressed in the local space defined by the normal and the base vector.
TBASIS(6)
Tangent and bitangent (binormal) packed together forming a tangent basis with the normal vector, usualy used for deforming mesh (ie. rigged character) normal mapping for real-time 3D engines.

(193) SDK: Declarations
 #define LXi_VMAP_OBJECTPOS      LXxID4('O','P','O','S')
 #define LXi_VMAP_MORPH          LXxID4('M','O','R','F')
 #define LXi_VMAP_SPOT           LXxID4('S','P','O','T')
 #define LXi_VMAP_NORMAL         LXxID4('N','O','R','M')
 #define LXi_VMAP_TEXTUREUV      LXxID4('T','X','U','V')
 #define LXi_VMAP_WEIGHT         LXxID4('W','G','H','T')
 #define LXi_VMAP_PICK           LXxID4('P','I','C','K')
 #define LXi_VMAP_EPCK           LXxID4('E','P','C','K')
 #define LXi_VMAP_RGB            LXxID4('R','G','B',' ')
 #define LXi_VMAP_RGBA           LXxID4('R','G','B','A')
 #define LXi_VMAP_SUBDIV         LXxID4('S','U','B','V')
 #define LXi_VMAP_VECTOR         LXxID4('V','E','C','T')
 #define LXi_VMAP_TBASIS         LXxID4('T','B','A','S')

Sometimes it's nice to have maps that are linked to specific items, especially for weights. This is done by setting a special prefix on the map name that is recognized as belonging to an item. The rest of the name is the internal item ident.

(194) SDK: Declarations
 #define LXsVMAP_ITEMPREFIX      "__item_"

Mesh Listener

A mesh listener can be attached to a mesh to be informed of changes.

NOTE: Needs to be fleshed out!

(195) SDK: ILxMeshListener interface
         LXxMETHOD( void,
 Destroy) (
         LXtObjectID              self);

This is called for mesh edit changes with event codes defined as LXf_MESHEDIT.

(196) SDK: ILxMeshListener interface
         LXxMETHOD( void,
 Changes) (
         LXtObjectID              self,
         unsigned                 event);

(197) SDK: Declarations
 #define LXu_MESHLISTENER        "9373A003-BEBC-44D4-ADEB-36862F0AFC38"

Mesh Operation

A mesh operation is a container for a modeling operating on a target mesh. It is a simple interface that takes a writeable mesh, and modifies the mesh in any way that it wants. This could be as simple as simply offsetting geometry positions, or it could be more complex, such as creating new geometry or editing mesh properties.

(198) SDK: Declarations
 #define LXu_MESHOPERATION               "98103095-54AC-45CD-8685-84614D996AC2"
 #define LXa_MESHOPERATION               "meshoperation"

The Evaluate function is used to perform the main evaluation. It is given an editable mesh, which should be edited in place, to perform the modeling operation. A selection mark mode and selection type is provided, to limit the operation to a particular subset of components.

(199) SDK: ILxMeshOperation interface
         LXxMETHOD( LxResult,
 Evaluate) (
         LXtObjectID              self,
         LXtObjectID              mesh,
         LXtID4                   type,
         LXtMarkMode              mode);

When a mesh operation creates new geometry, it can be inefficient to recreate the geometry for every evaluation. This set of optional functions allow the previous evaluation result to be used as a starting point for the current evaluation. For example, a bevel tool may use the initial evaluation to create the beveled polygons, and any further evaluation calls may simply offset the position of the beveled geometry.

The Compare function is used to compare one mesh operation with another. The old mesh operation is passed to the new mesh operation and the attributes should be compared, to see if they are compatible. If the function returns DIFFERENT, then the operation will be discarded and evaluated from scratch. If the function returns COMPATIBLE, then the previous result will be used as a starting point for the next evaluation. If the function returns IDENTICAL, then re-evaluation of the mesh operation will be skipped altogether, and the previous result will be used, as is.

(200) SDK: Declarations

(201) SDK: ILxMeshOperation interface
         LXxMETHOD( int,
 Compare) (
         LXtObjectID              self,
         LXtObjectID              other);

If the previous mesh operation is compatible, then Convert will be called to transfer variables and user data from the old mesh operation to the new mesh operation. The function will be passed the old operation and any variables should be transferred.

(202) SDK: ILxMeshOperation interface
         LXxMETHOD( LxResult,
 Convert) (
         LXtObjectID              self,
         LXtObjectID              other);

The ReEvaluate function is called to perform a fast update to a previous mesh. The mesh from the previous evaluation result is passed to the function, and the mesh operation is expected to simply update the mesh in place.

(203) SDK: ILxMeshOperation interface
         LXxMETHOD( LxResult,
 ReEvaluate) (
         LXtObjectID              self,
         LXtObjectID              mesh,
         LXtID4                   type);

The SetTransform function is used to provide the Mesh Operation with a transform matrix to use for evaluation.

(204) SDK: ILxMeshOperation interface
         LXxMETHOD( LxResult,
 SetTransform) (
         LXtObjectID              self,
         LXtMatrix4               matrix);

(205) User Class: MeshOperation method

Empty Mesh Operation Python user class.

(206) PY: MeshOperation method
 pass

Mesh Filters

Mesh filters are added to evaluation stacks in order to perform mesh operations during evaluation. They can also be read during evaluation to get deforming meshes.

The Type() method returns the type of filter, given by one of the codes below. These select which operational method is called and how its results are interpreted.

(207) SDK: ILxMeshFilter interface
         LXxMETHOD(  unsigned,
 Type) (
         LXtObjectID              self);

(208) SDK: Declarations
 #define LXiFILT_MODIFY          1
 #define LXiFILT_GENERATE        2
 #define LXiFILT_SOURCE          3

If the type of filter is MODIFY, then the Evaluate() method is used to transform a mesh. A writable mesh is passed as input and should be modified in placed based on the settings of the filter.

(209) SDK: ILxMeshFilter interface
         LXxMETHOD(  LxResult,
 Evaluate) (
         LXtObjectID              self,
         LXtObjectID              mesh);

For GENERATE and SOURCE type filters the Generate() function is called and it returns a new mesh to replace the input mesh. For GENERATE filters the mesh is instanced while with SOURCE filters the result is used directly.

(210) SDK: ILxMeshFilter interface
         LXxMETHOD(  LxResult,
 Generate) (
         LXtObjectID              self,
         void                   **ppvObj);

(211) SDK: Declarations
 #define LXu_MESHFILTER  "F5896BA1-7EC5-4EE9-852F-BF977E451953"

(212) User Class: MeshFilter method
         bool
 GetMesh (
         CLxLoc_Mesh             &mesh)
 {
         return Generate (mesh);
 }

Empty MeshFilter Python user class.

(213) PY: MeshFilter method
 pass

Mesh Filter BBox

The bounding box interface only computes the mesh bounding box.

(214) SDK: ILxMeshFilterBBox interface
         LXxMETHOD(  LxResult,
 Evaluate) (
         LXtObjectID              self,
         LXtBBox                 *box);

(215) SDK: Declarations
 #define LXu_MESHFILTERBBOX      "FBD83166-4B50-42A0-8C91-C36D3BB76904"

(216) User Class: MeshFilterBBox method

Empty MeshFilterBBox Python user class.

(217) PY: MeshFilterBBox method
 pass

Mesh Filter Ident

The ident interface returns a mesh in the mesh stack that has a matching ident. The ident is usually defined as the item ident of the Mesh Operation or Deformer that generated the filter in the mesh stack. If no mesh can be found with the provided ident, the function will return LXe_NOTFOUND.

An BASE identifier will return the non-editable base mesh. And obviously top will return the topmost mesh in the stack.

(218) SDK: Declarations
 #define LXs_MESHFILTER_BASE     "__base__"
 #define LXs_MESHFILTER_TOP      "__top__"

(219) SDK: ILxMeshFilterIdent interface
         LXxMETHOD(  LxResult,
 Generate) (
         LXtObjectID              self,
         const char              *ident,
         void                   **ppvObj);

(220) SDK: Declarations
 #define LXu_MESHFILTERIDENT     "68713DE3-45D8-4722-BC43-D03EF4964AB8"

(221) User Class: MeshFilterIdent method
         bool
 GetMesh (
         std::string              ident,
         CLxLoc_Mesh             &mesh)
 {
         if (ident.length () > 0)
                 return Generate (ident.c_str (), mesh);
 
         return false;
 }

Empty MeshFilterIdent Python user class.

(222) PY: MeshFilterIdent method
 pass