FormIt C++ API  v23.0.0 (2023.0.0)
WSM API Reference List

Description

Namespaces

 WSM::ApiProgress
 

Classes

class  WSM::Color
 The Color class stores an RGBA color value. More...
 
struct  WSM::FacetsBodyData
 Contains data for constructing a Body from facets. More...
 
struct  WSM::TextureData
 Data used to construct a texture. More...
 
struct  WSM::MaterialData
 Data used to construct a material. More...
 
struct  WSM::LayerData
 Data used to construct a layer. More...
 
struct  WSM::InstanceData
 Data used to construct a group instance. More...
 
struct  WSM::LoopData
 Data used to construct a loop in a face. More...
 
struct  WSM::FaceData
 Data used to construct a face. More...
 
struct  WSM::EdgeData
 Data used to construct an edge. More...
 
struct  WSM::CurveData
 Data used to construct a string of edges. More...
 
struct  WSM::ImageData
 Data used to construct a rectangular face with a texture on it. More...
 
struct  WSM::ATFCameraData
 Data used to pass camera information to and from ATF. More...
 
class  WSM::Interval2d
 The Interval2d class corresponds to a bounding box in 2D space. More...
 
class  WSM::Interval3d
 The Interval3d class corresponds to a bounding box in 3D space. More...
 
class  WSM::Line3d
 The Line3d class stores an oriented line and/or an axis, defined by a Point3d and a Vector3d. More...
 
class  WSM::ObjectHistoryID
 The ObjectHistoryID class combines a history ID and an object ID into a single object. More...
 
class  WSM::GroupInstancePath
 Private member m_aPaths in GroupInstancePath is not exported and causes a warning that can be safely ignored. More...
 
class  WSM::Plane
 The Plane class stores an oriented plane in 3D. More...
 
class  WSM::Point2d
 The Point2d class stores a point in 2D space. More...
 
class  WSM::Point3d
 The Point3d class stores a point in 3D space. More...
 
class  WSM::Result
 Private member m_pRI in Result is not exported and causes a warning that can be safely ignored. More...
 
class  WSM::Transf3d
 The Transf3d class represents a general affine or projective transformation in 3D space. More...
 
class  WSM::UnitVector3d
 The UnitVector3d class stores a unit vector in 3D space. More...
 
class  WSM::Vector2d
 The Vector2d class stores a vector in 2D space. More...
 
class  WSM::Vector3d
 The Vector3d class stores a vector in 3D space. More...
 
struct  WSM::ModelChangeData
 The type of data passed to a callback that will be called upon the completion of each Delta or Undo/Redo operation within any non-temporary History, and the creation or deletion of non-temporary histories. More...
 
class  WSM::IRayFireFilterAndAbort
 ! Interface class used by APIRayFireReadOnly and APIIntersectsNegativeSideOfPlanesReadOnly. More...
 
class  WSM::AbstractLockGuard
 WSM::AbstractLockGuard class. More...
 

Typedefs

using WSM::IsObjectHiddenFunctionType = 1::function< bool(const WSM::GroupInstancePath &, double)>
 ! Callback function type used by APISlice ! It receives a WSM::GroupInstancePath object and a depth parameter. More...
 

Enumerations

enum  WSM::nObjectType {
  WSM::nUnSpecifiedType = 0, WSM::nBodyType = 1, WSM::nLumpType = 2, WSM::nShellType = 3,
  WSM::nFaceType = 4, WSM::nLoopType = 5, WSM::nCoedgeType = 6, WSM::nEdgeType = 7,
  WSM::nVertexType = 8, WSM::nMaterialAttributeType = 9, WSM::nMaterialType = 10, WSM::nCircleAttributeType = 11,
  WSM::nObjectPropertiesAttributeType = 12, WSM::nTextureType = 13, WSM::nLevelAttributeType = 14, WSM::nLevelType = 15,
  WSM::nSketchPropertiesType = 16, WSM::nSplineCurveAttributeType = 17, WSM::nCylinderSurfaceAttributeType = 18, WSM::nSphereSurfaceAttributeType = 19,
  WSM::nExtrudeSurfaceAttributeType = 20, WSM::nImageType = 21, WSM::nSatelliteDataAttributeType = 22, WSM::nGroupType = 23,
  WSM::nInstanceType = 24, WSM::nLayerAttributeType = 25, WSM::nLayerType = 26, WSM::nGeneratedGeometryInformationType = 27,
  WSM::nFaceUVDataAttributeType = 28, WSM::nEdgeStyleAttributeType = 29, WSM::nBlendAttributeType = 30, WSM::nStringAttributeType = 31,
  WSM::nMeshType = 32, WSM::nLineMeshType = 33, WSM::nPointMeshType = 34, WSM::nNumObjectTypes
}
 Supported object types. More...
 
enum  WSM::nFileType : int {
  WSM::nFileTypeBinaryWSM = 0, WSM::nFileTypeSAT = 1, WSM::nFileTypeSTL = 2, WSM::nFileTypeOBJ = 3,
  WSM::nFileTypeDWG = 4, WSM::nFileTypeLMV = 5, WSM::nFileTypeThreejsJSON = 6, WSM::nFileTypeFBX = 7,
  WSM::nFileTypeSKP = 8, WSM::nFileTypeDAE = 9, WSM::nFileTypeDXF = 10, WSM::nFileTypeJSON = 11,
  WSM::nFileTypeATFX = 12
}
 Supported file types. Passed to save/load APIs to specify the file type. More...
 
enum  WSM::nConvexity {
  WSM::nConvexityUnset = 0x00, WSM::nConvexitySmooth = 0x01, WSM::nConvexityConcave = 0x02, WSM::nConvexityConvex = 0x04,
  WSM::nConvexityMixed = 0x08, WSM::nConvexityNonManifold = 0x10
}
 Enumerated type with bitfield values that define the Loop or Edge convexity. More...
 
enum  WSM::nLoadingOptions : size_t {
  WSM::nLoadingOptions::NoOptions = 0, WSM::nLoadingOptions::Merge = 1, WSM::nLoadingOptions::PlaceOnGround = 2, WSM::nLoadingOptions::RemoveDuplicate = 4,
  WSM::nLoadingOptions::SmoothingByAngle = 8, WSM::nLoadingOptions::CreateMesh = 16
}
 Available options for the nOptions argument of APILoadFromFile() More...
 
enum  WSM::DeltaFlag : size_t { WSM::DeltaFlag::nNotMine = 0x01, WSM::DeltaFlag::nAddedToOutQueue = 0x02, WSM::DeltaFlag::nSentToServer = 0x04, WSM::DeltaFlag::nServerAccepted = 0x08 }
 
enum  WSM::nCopyBehavior : size_t { WSM::nCopyBehavior::nDoNotCopyNorShare = 0, WSM::nCopyBehavior::nShareOrCopy = 1, WSM::nCopyBehavior::nCopyAlways = 2, WSM::nCopyBehavior::nNumCopyBehaviors = 3 }
 Enumerated type describing an Object's copy behavior. More...
 
enum  WSM::nHistoryComparison : size_t {
  WSM::nIdentical = 0x00, WSM::nLessAcceptedDeltas = 0x01, WSM::nMoreAcceptedDeltas = 0x02, WSM::nMoreLocalDeltas = 0x04,
  WSM::nLocalActiveDeltaLower = 0x08, WSM::nLocalActiveDeltaHigher = 0x10, WSM::nOutOfSync = 0x20
}
 Results of History check produced by APICheckHistoryReadOnly(), which checks the local History of this client and remote History of the collaboration server, the latter contains only "accepted" Deltas. More...
 

Functions

bool WSM::operator&& (const Point2d p, const Interval2d &interv)
 Returns true iff the given interval contains the given point. More...
 
bool WSM::operator&& (const Point3d &p, const Interval3d &interv)
 Returns true iff the given interval contains the given point. More...
 
bool WSM::overlap (const Interval3d &i1, const Interval3d &i2)
 Returns true iff the two given intervals overlap. More...
 
bool WSM::point_inside (Interval3d const &i, Point3d const &p)
 Returns true iff the given point lies inside the given interval. More...
 
WSM_EXPORT void WSM::AppendToGroupInstancePathArray (WSM::GroupInstancePath const &path, 1::vector< size_t > const &aInput, 1::vector< WSM::GroupInstancePath > &aOutput)
 Takes a WSM::GroupInstancePath and a vector of objects ID values in the same history, and populates the GroupInstancePath vector with that data. More...
 
WSM_EXPORT void WSM::AppendToGroupInstancePathArray (size_t nHistoryID, 1::vector< size_t > const &aInput, 1::vector< WSM::GroupInstancePath > &aOutput)
 Takes a history ID and a vector of objects ID values, and adds to the GroupInstancePath vector with that data. More...
 
WSM_EXPORT void WSM::AppendToGroupInstancePathArray (size_t nHistoryID, 1::vector< WSM::ObjectHistoryID > const &aInput, 1::vector< WSM::GroupInstancePath > &aOutput)
 Takes a history ID and a vector of objects ID values, and adds to the GroupInstancePath vector with that data. More...
 
WSM_EXPORT bool WSM::PointIntersectsNegativeSideOfPlanes (const Point3d &pt, const 1::vector< Plane > &aPlanes, double dTol=WSM_MACHINE_TOL)
 Returns true if the point intersects the negative side of all the Planes. More...
 
WSM_EXPORT bool WSM::SegmentIntersectsNegativeSideOfPlanes (const Point3d &pt1, const Point3d &pt2, const 1::vector< Plane > &aPlanes, double dTol=WSM_MACHINE_TOL, bool bTestEndPts=true)
 Returns true if the segment from pt1 to pt2 intersects on the negative side of all the Planes. More...
 
WSM_EXPORT bool WSM::BoxIntersectsNegativeSideOfPlanes (const Interval3d &box, const 1::vector< Plane > &aPlanes, double dTol=WSM_MACHINE_TOL)
 Returns true if the box intersects the negative side of all the Planes. More...
 
WSM_EXPORT bool WSM::BoxLiesOnNegativeSideOfPlanes (const Interval3d &box, const 1::vector< Plane > &aPlanes, double dTol=WSM_MACHINE_TOL)
 Returns true if the box lies totally on the negative side of all the Planes. More...
 
WSM::Point2d WSM::intersect (const WSM::Point2d &p1, const WSM::Vector2d &v1, const WSM::Point2d &p2, const WSM::Vector2d &v2, bool &succeeded, double tolerance=WSM_DISTANCE_TOL)
 intersection of two 2d lines (p1,v1) and (p2,v2) More...
 
bool WSM::doIntersect (const WSM::Point2d &p1, const WSM::Point2d &p2, const WSM::Point2d &q1, const WSM::Point2d &q2, double tolerance=WSM_DISTANCE_TOL)
 Retuns true if the two line segments (p1,p2) and (q1,q2) intersect or overlap, false otherwise. More...
 
WSM_EXPORT WSM::Point2d WSM::projectPointOnLine (const WSM::Point2d &p, const WSM::Point2d &lpoint, const WSM::Vector2d &lvector)
 Project point p on line (lpoint, lvector) More...
 
double WSM::ComputeDeterminant (const WSM::Point3d &a, const WSM::Point3d &b, const WSM::Point3d &c)
 ComputeDeterminant function. More...
 
WSM_EXPORT void WSM::ComputeFaceXAndYVectors (const WSM::UnitVector3d &norm, WSM::Vector3d &faceX, WSM::Vector3d &faceY)
 Compute the faceX and faceY vectors to generate texture coordinates based a plane normal. More...
 
constexpr bool WSM::enable_bitmask_operators (nLoadingOptions)
 enable_bitmask_operators function. More...
 
WSM_EXPORT Result WSM::APIGetVersionReadOnly (size_t &nMajorVer, size_t &nMinorVer, size_t &nRevisionVer)
 Returns the Major, Minor, and Revision software versions used to identify the released version of WSM. More...
 
WSM_EXPORT Result WSM::APIGetDatabaseVersionReadOnly (size_t &nMajorVer, size_t &nMinorVer)
 Returns the Major and Minor software versions which is used when saving and loading files and strings. More...
 
WSM_EXPORT Result WSM::APICreateHistory (size_t &nHistoryID, bool bNonTemporary=true)
 Create a History and return the History ID. More...
 
WSM_EXPORT Result WSM::APIDeleteHistory (size_t nHistoryID)
 Delete a History and all Objects in it. More...
 
WSM_EXPORT Result WSM::APICanRedoHistoryReadOnly (size_t nHistoryID, bool &bCanRedo)
 Sets bCanRedo to true if it is possible to redo one Delta. More...
 
WSM_EXPORT Result WSM::APICanUndoHistoryReadOnly (size_t nHistoryID, bool &bCanUndo)
 Sets bCanUndo to true if it is possible to undo one Delta. More...
 
WSM_EXPORT Result WSM::APICanRedoHistoryToDeltaReadOnly (size_t nHistoryID, size_t nDeltaID, bool &bCanRedo)
 Sets bCanRedo to true if it is possible to redo to nDeltaID. More...
 
WSM_EXPORT Result WSM::APICanUndoHistoryToDeltaReadOnly (size_t nHistoryID, size_t nDeltaID, bool &bCanUndo)
 Sets bCanUndo to true if it is possible to undo to nDeltaID. More...
 
WSM_EXPORT Result WSM::APIUndoHistory (size_t nHistoryID, bool bAndDeleteRedo=false, size_t nApplyOnDeltaID=WSM::INVALID_ID)
 Step backward one Delta. More...
 
WSM_EXPORT Result WSM::APIUndoHistoryToDelta (size_t nHistoryID, size_t nDeltaID)
 Step backward until the given Delta is reached. More...
 
WSM_EXPORT Result WSM::APIRedoHistory (size_t nHistoryID, size_t nApplyOnDeltaID=WSM::INVALID_ID)
 Step forward one Delta. More...
 
WSM_EXPORT Result WSM::APIRedoHistoryToDelta (size_t nHistory, size_t nDeltaID)
 Step forward until the given Delta is reached. More...
 
WSM_EXPORT Result WSM::APIUndoOrRedoHistoryToDelta (size_t nHistoryID, size_t nDeltaID, bool bAndDeleteRedo=false)
 Step backward or forward until the given Delta is reached, and optionally delete redo information when undoing. More...
 
WSM_EXPORT Result WSM::APIDeleteAllRedoHistory (size_t nHistoryID, bool bReuseDiscardedObjectIDs=false)
 Deletes all forward Deltas. More...
 
WSM_EXPORT Result WSM::APIGetAllHistoryDeltasReadOnly (size_t nHistoryID, 1::vector< size_t > &aDeltaIDs)
 Get the IDs of all deltas in the given history. More...
 
WSM_EXPORT Result WSM::APIGetHistoryDeltasReadOnly (size_t nHistoryID, size_t nStartDeltaID, size_t nEndDeltaID, 1::vector< size_t > &aDeltaIDs)
 Get the IDs of the deltas in the given closed range in the given history. More...
 
WSM_EXPORT Result WSM::APIDeleteAllHistories ()
 Delete all Histories in WSM and reset next History Id to be 0. This cannot be undone. More...
 
WSM_EXPORT Result WSM::APIGetAllHistoriesReadOnly (1::vector< size_t > &aIDs, bool bWantTemporary=false)
 Gets a sorted vector of the IDs of all active histories, optionally excluding temporary. More...
 
WSM_EXPORT Result WSM::APIGetAllReachableHistoriesReadOnly (size_t nHistoryID, bool bGoUp, 1::vector< size_t > &aHistoryIDs)
 Gets all the Histories reachable from the given History going either up or down the chain of Histories based on the flag bGoUp. More...
 
WSM_EXPORT Result WSM::APIGetHistoryReferencingGroupsReadOnly (size_t nHistoryID, 1::vector< WSM::ObjectHistoryID > &aObjectIDs)
 Returns a vector with groups that reference this history. More...
 
WSM_EXPORT Result WSM::APIGetIdOfActiveDeltaReadOnly (size_t nHistoryID, size_t &nActiveDeltaID, int nDeltaOffset=0)
 Get the active Delta ID. More...
 
WSM_EXPORT Result WSM::APIGetLastDeltaIDReadOnly (size_t nHistoryID, size_t &nLastDeltaID, size_t nBeforeLast=0)
 Get the ID of the target Delta, which is nBeforeLast before the last Delta (even for zero nBeforeLast, it may be different from the active Delta ID, if there are available Redo states). More...
 
WSM_EXPORT Result WSM::APIMergeDeltas (size_t nHistoryID, size_t nStartDeltaID=WSM::INVALID_ID, size_t nEndDeltaID=WSM::INVALID_ID, bool bReuseDiscardedObjectIDs=true)
 Merges consecutive Deltas with the specified starting and ending IDs. More...
 
WSM_EXPORT Result WSM::APICreateEmptyBody (size_t nHistoryID, size_t &nCreatedObjectID)
 Creates an empty Body. More...
 
WSM_EXPORT Result WSM::APICreatePolyline (size_t nHistoryID, const 1::vector< WSM::Point3d > &aPoints, size_t &nCreatedFaceID, bool bForceClosed=true)
 Creates a polyline using 3D sketching not linking with existing topology. More...
 
WSM_EXPORT Result WSM::APICreateExtrusion (size_t nHistoryID, const 1::vector< WSM::Point3d > &aPoints, double dist, size_t &nCreatedObjectID)
 Create an extrusion on the given History. More...
 
WSM_EXPORT Result WSM::APICreateCylinder (size_t nHistoryID, const WSM::Point3d &aPosCenter, double aRadius, double aHeight, size_t &nCreatedObjectID, double aAccuracyORcount=10, const WSM::UnitVector3d &aAxis=WSM::UnitVector3d::kZDir)
 Create a cylinder on the given History. More...
 
WSM_EXPORT Result WSM::APICopyObject (const size_t nFromHistoryID, size_t nToHistoryID, const size_t nFromObjectID, size_t &nCreatedObjectID)
 Create a copy of the Object in the given History. More...
 
WSM_EXPORT Result WSM::APITransformObject (size_t nHistoryID, size_t nObjectID, const WSM::Transf3d &t)
 Transforms the given Object. More...
 
WSM_EXPORT Result WSM::APITransformObjects (size_t nHistoryID, const 1::vector< size_t > &aObjectIDs, const WSM::Transf3d &t)
 Transforms the given Objects. More...
 
WSM_EXPORT Result WSM::APICopyOrSketchAndTransformObjects (const size_t nFromHistoryID, const size_t nToHistoryID, const 1::vector< size_t > &aFromObjectIDs, 1::vector< size_t > &aCopiedObjectIDs, const WSM::Transf3d &transform=WSM::Transf3d::kIdentity, const size_t nNumCopies=1, bool bGroupBodies=false, const WSM::Transf3d *pGroupTransf3d=nullptr)
 Copies the given objects as an array of incremental transforms. More...
 
WSM_EXPORT Result WSM::APIDeleteObject (size_t nHistoryID, size_t nObjectID)
 Deletes the given Object including all its children. More...
 
WSM_EXPORT Result WSM::APIDeleteObjects (size_t nHistoryID, const 1::vector< size_t > &aObjectIDs)
 Deletes a vector of Objects including all their children. More...
 
WSM_EXPORT Result WSM::APIMoveVertices (size_t nHistoryID, const 1::vector< size_t > &aVertexIDs, const 1::vector< WSM::Point3d > &aNewVertexPositions)
 Move the given vertices to the new locations. More...
 
WSM_EXPORT Result WSM::APIMoveObject (size_t nHistoryID, const size_t objectID, const WSM::Vector3d &displacement)
 Move the vertices of the given object with the given displacement if it is owned; otherwise, transform the given object with the given displacement. More...
 
WSM_EXPORT Result WSM::APIMoveObjects (size_t nHistoryID, const 1::vector< size_t > &objectIDs, const WSM::Transf3d &t)
 Move the vertices of each object with the given transformation if it is owned;otherwise, transform the given object. More...
 
WSM_EXPORT Result WSM::APIAddFaceComponentToBody (size_t nHistoryID, size_t nFaceID, size_t nBodyID)
 Adds a Face and all connected Faces to a Body. More...
 
WSM_EXPORT Result WSM::APIDragFace (size_t nHistoryID, size_t nFaceID, double dDist, bool bMerge=false)
 Drags a Face in the direction of its normal by the given distance. More...
 
WSM_EXPORT Result WSM::APIDragFaces (size_t nHistoryID, const 1::vector< 1::vector< size_t >> &aaFaceIDs, const 1::vector< double > &aDists, const 1::vector< WSM::UnitVector3d > *aDirs=nullptr, bool bMerge=false)
 Drag multiple Faces, in the same manner as APIDragFace(). More...
 
WSM_EXPORT Result WSM::APIScaleFace (size_t nHistoryID, size_t nFaceID, double dScaleFactor)
 Scales a Face by given scale factor, around its centroid. More...
 
WSM_EXPORT Result WSM::APIOffsetFace (size_t nHistoryID, size_t nFaceID, double dOffsetDistance, bool bOffsetHolesToo=false, const WSM::Transf3d &trans=WSM::Transf3d::kIdentity, 1::vector< 1::vector< WSM::Point3d >> *paOffsetPoint3Ds=nullptr)
 Offsets a Face by given distance. More...
 
WSM_EXPORT Result WSM::APIOffsetEdges (size_t nHistoryID, const 1::vector< size_t > &nEdgeIDs, double dOffsetDistance, const WSM::Transf3d &trans=WSM::Transf3d::kIdentity, 1::vector< 1::vector< WSM::Point3d >> *paOffsetPoint3Ds=nullptr)
 Offsets given Edges by given distance. More...
 
WSM_EXPORT Result WSM::APIRotateFace (size_t nHistoryID, size_t nFaceID, double dRadians)
 Rotates a Face by a given angle. More...
 
WSM_EXPORT Result WSM::APIRotateFaceBetweenPoints (size_t nHistoryID, size_t nFaceID, const WSM::Point3d &startPt, const WSM::Point3d &endPt)
 Rotates a Face between two given points. More...
 
WSM_EXPORT Result WSM::APITaperFace (size_t nHistoryID, size_t nFaceID, double dRadians, const WSM::Line3d &axis)
 Taper a Face by angle of rotation around the given axis. More...
 
WSM_EXPORT Result WSM::APIGetFaceCentroidPoint3dReadOnly (size_t nHistoryID, size_t nFaceID, WSM::Point3d &centroidPt)
 Get a Face centroid point. More...
 
WSM_EXPORT Result WSM::APIGetFaceConnectedComponentReadOnly (size_t nHistoryID, size_t nFaceID, bool bUseVertices, bool bSmooth, 1::vector< size_t > &aConnectedFaces)
 Using the given Face ID, finds all Faces connected across Edges or Vertices, as controlled by bUseVertices and bSmooth. More...
 
WSM_EXPORT Result WSM::APIGetConvexityConnectedComponentReadOnly (size_t nHistoryID, size_t nFaceID, size_t nConvexity, 1::vector< size_t > &aConnectedFaces)
 Using the given FaceID, finds all Faces connected across Edges, as controlled by nConvexity. More...
 
WSM_EXPORT Result WSM::APIGetConvexityReadOnly (size_t nHistoryID, size_t nEdgeOrLoopID, WSM::nConvexity &eConvextity)
 Get a Loop or Edge convexity. More...
 
WSM_EXPORT Result WSM::APIGetFaceVariantReadOnly (size_t nHistoryID, size_t nFaceID, double &dVariant)
 Get a Face variant. More...
 
WSM_EXPORT Result WSM::APIMergeBody (size_t nHistoryID, size_t nBodyID, double dSmoothCosAngle=WSM_TIGHT_SMOOTH_COSINE_ANGLE)
 Merges all the merge-able Edges and Vertices out of a Body. More...
 
WSM_EXPORT Result WSM::APIGetFacePlaneReadOnly (const size_t nHistoryID, const size_t nFaceID, WSM::Plane &plane)
 Get the Face Plane. More...
 
WSM_EXPORT Result WSM::APIGetFaceVertexNormalsReadOnly (const size_t nHistoryID, const size_t nFaceID, 1::vector< 1::pair< size_t, WSM::UnitVector3d > > &aVertexNormals)
 Get normals for each Vertex of the given Face, averaging face normals across smooth edges. More...
 
WSM_EXPORT Result WSM::APICreateBlock (const size_t nHistoryID, const WSM::Point3d &pos1, const WSM::Point3d &pos2, size_t &nCreatedObjectID)
 Create a block with the given corners. More...
 
WSM_EXPORT Result WSM::APICreateHemisphere (const size_t nHistoryID, const double radius, const WSM::Point3d &posCenter, size_t &nCreatedObjectID, const double accuracyORcount=10.0)
 Create a half sphere (above Z=0) with given parameters. More...
 
WSM_EXPORT Result WSM::APICreateCone (const size_t nHistoryID, const double radius, const double height, const WSM::Point3d &posCenter, size_t &nCreatedObjectID, const double accuracyORcount=10.0)
 Create a cone (above Z=0) with given parameters. More...
 
WSM_EXPORT Result WSM::APICreateCircleOrArc (const size_t nHistoryID, const double radius, const WSM::Point3d &posCenter, 1::vector< WSM::Point3d > &aPoints, const WSM::UnitVector3d &xAxis=WSM::UnitVector3d::kXDir, const WSM::UnitVector3d &yAxis=WSM::UnitVector3d::kYDir, double dStartParam=0.0, double dEndParam=WSM_2PI, const double accuracyORcount=10.0, bool bReadOnly=false, const WSM::Transf3d &trans=WSM::Transf3d::kIdentity, size_t nMinimumNumberOfFacets=0)
 Create a vector of Point3ds of a circle or arc defined by C(t) = posCenter + radius * (xAxis * cos(t) + yAxis * sin(t)), where t goes from dStartParam to dEndParam. More...
 
WSM_EXPORT Result WSM::APICreateCircleOrArcFromPoints (const size_t nHistoryID, const WSM::Point3d &arcStartPos, const WSM::Point3d &arcEndPos, const WSM::Point3d &thirdPoint, 1::vector< WSM::Point3d > &aPoints, const double accuracyORcount=10.0, bool bReadOnly=false, const WSM::Transf3d &trans=WSM::Transf3d::kIdentity, size_t nMinimumNumberOfFacets=0, bool bCircle=false)
 Create a vector of Point3ds of a circular arc, defined with a arcStartPos, arcEndPos, and a thirdPoint. More...
 
WSM_EXPORT Result WSM::APICreateRectangle (const size_t nHistoryID, const WSM::Point3d &firstEdgePt1, const WSM::Point3d &firstEdgePt2, const WSM::Point3d &projectionPt, 1::vector< WSM::Point3d > &aCreatedPts, bool bReadOnly=false)
 Create a rectangle based on one edge and a third point. More...
 
WSM_EXPORT Result WSM::APICreateHermiteSpline (const size_t nHistoryID, const 1::vector< WSM::Point3d > &aControlPoints, 1::vector< WSM::Point3d > &aOutPoints, bool bClosed=false, const WSM::Vector3d &startTangent=WSM::Vector3d::kNull, const WSM::Vector3d &endTangent=WSM::Vector3d::kNull, bool bReadOnly=false, 1::vector< double > *aOutPointsParams=nullptr)
 Tessellate a cubic spline that touches all aControlPoints. More...
 
WSM_EXPORT Result WSM::APICreateClampedHermiteSplineDataReadOnly (const size_t nHistoryID, const 1::vector< WSM::Point3d > &aControlPoints, const WSM::Vector3d &startTangent, const WSM::Vector3d &endTangent, bool bClosed, const 1::vector< size_t > &aVertexIDsOnSpline, size_t nNumberOfNewContolPoints, 1::vector< WSM::Point3d > &aNewControlPoints, WSM::Vector3d &startTangentNew, WSM::Vector3d &endTangentNew, bool &bClosedNew, 1::map< double, size_t > &mVertextParameterMap)
 Create a clamped cubic spline from the data of a spline and the original vertex points on the spline. More...
 
WSM_EXPORT Result WSM::APIGetBoxReadOnly (const size_t nHistoryID, const size_t nObjectID, WSM::Interval3d &Box, const WSM::Transf3d &transform=WSM::Transf3d::kIdentity)
 Returns the bounding box of a Object. More...
 
WSM_EXPORT Result WSM::APIGetBodyFacesReadOnly (const size_t nHistoryID, const size_t nBodyID, 1::vector< size_t > &aFaceIDs)
 Returns the Faces of a Body. More...
 
WSM_EXPORT Result WSM::APIFaceContainsPointReadOnly (const size_t nHistoryID, const size_t nFaceID, const Point3d &point, bool &bContainsPoint)
 Does the given Face contain the given Point3d? More...
 
WSM_EXPORT Result WSM::APIGetObjectsByTypeReadOnly (const size_t nHistoryID, const size_t nObjectID, const WSM::nObjectType nType, 1::vector< size_t > &aIDs, bool bUpstream=false)
 If the given bUpstream argument is false, returns all the objects of type nType contained by the given pbject; otherwise, returns all the objects of type nType which are the parents of given object. More...
 
WSM_EXPORT Result WSM::APIGetAllObjectsByTypeReadOnly (const size_t nHistoryID, const WSM::nObjectType nType, 1::vector< size_t > &aIDs)
 Returns all live objects of type nType in the given history. More...
 
WSM_EXPORT Result WSM::APIGetBodyEdgesReadOnly (const size_t nHistoryID, const size_t nBodyID, 1::vector< size_t > &aEdgeIDs)
 Returns the Edges of a Body. More...
 
WSM_EXPORT Result WSM::APIGetFaceFacetsReadOnly (const size_t nHistoryID, const size_t nFaceID, 1::vector< size_t > &aFacets)
 Returns the Facets of a Face. More...
 
WSM_EXPORT Result WSM::APIGetVertexPoint3dReadOnly (const size_t nHistoryID, const size_t nVertexID, WSM::Point3d &Pt)
 Returns the Point3d of a Vertex. More...
 
WSM_EXPORT Result WSM::APICheckValidityReadOnly (const size_t nHistoryID, const size_t nObjectID, 1::vector< Result > &aErrors)
 Finds all errors on the Object. More...
 
WSM_EXPORT Result WSM::APICheckHistoryValidityReadOnly (const size_t nHistoryID, 1::vector< Result > &aErrors)
 Finds all errors in the History (including on every live Object in the History). More...
 
WSM_EXPORT Result WSM::APIIsNonOwnedReadOnly (const size_t nHistoryID, const size_t nObjectID, bool &bIsNonOwned)
 Returns whether this object has an owner. More...
 
WSM_EXPORT Result WSM::APIGetAllNonOwnedReadOnly (const size_t nHistoryID, 1::vector< size_t > &aNonOwned)
 Returns all non owned Objects in the given History. More...
 
WSM_EXPORT Result WSM::APIGetAllConnectedNonOwnedReadOnly (const size_t nHistoryID, const size_t nObjectID, 1::vector< size_t > &aNonOwned)
 Returns all non owned Objects in the given History that are connected to the given Object. More...
 
WSM_EXPORT Result WSM::APIGetConnectedEdgesReadOnly (const size_t nHistoryID, const size_t nEdgeID, 1::vector< size_t > &aConnectedEdges, bool bBreakOnNonSmooth)
 Returns all connected edges of a seed edge. More...
 
WSM_EXPORT Result WSM::APIGetObjectTypeReadOnly (const size_t nHistoryID, const size_t nObjectID, nObjectType &nType)
 Returns Object's type in the given History. More...
 
WSM_EXPORT Result WSM::APIGetEdgeOrVertexMarkedSmoothReadOnly (const size_t nHistoryID, const size_t nObjectID, bool &bIsSmooth)
 Returns whether an edge or vertex is marked as smooth. More...
 
WSM_EXPORT Result WSM::APISetEdgesOrVerticesMarkedSmooth (const size_t nHistoryID, const 1::vector< size_t > &aObjectIDs, bool bSmooth)
 Marks the smoothness of all Objects specified in aObjectIDs. More...
 
WSM_EXPORT Result WSM::APIIsEdgeSilhouetteReadOnly (const size_t nHistoryID, const size_t nEdgeID, const WSM::Point3d &cameraPos, const WSM::Vector3d &cameraDir, bool bPerspectiveView, bool &bIsSilhouette)
 Returns whether or not an Edge is a silhouette Edge based on the camera position, the camera direction, the view type being perspective or orthogonal. More...
 
WSM_EXPORT Result WSM::APIDetectSilhouettesReadOnly (const size_t nHistoryID, const 1::vector< size_t > &aEdgeIDs, const WSM::Point3d &cameraPos, const WSM::Vector3d &cameraDir, bool bPerspectiveView, bool bSmoothOnly, 1::vector< size_t > &aSilIDs)
 Takes a list of edge ids and a camera, and returns the ids which contribute to the silhouette. More...
 
WSM_EXPORT Result WSM::APIDetectFreeEdgesReadOnly (const size_t nHistoryID, const 1::vector< size_t > &aEdgeIDs, 1::vector< size_t > &aFreeEdgeIDs, 1::vector< size_t > &aNonFreeEdgeIDs)
 Takes a list of edges, and returns a list of edges which have 1 or 0 connected faces and a list of the non free edges. More...
 
WSM_EXPORT Result WSM::APIGetEdgeFaceClassificationReadOnly (const size_t nHistoryID, const 1::vector< size_t > &aEdgeIDs, 1::vector< int > &aFaceClassification)
 Takes a list of edges, and returns an array of int that describes the edge face classification for each edge. More...
 
WSM_EXPORT Result WSM::APIIsEdgeManifoldReadOnly (const size_t nHistoryID, const size_t nEdgeID, bool &bIsManifold)
 Returns whether an edge has exactly two coedges on two distinct faces. More...
 
WSM_EXPORT Result WSM::APIGetMemorySizeReadOnly (const size_t nHistoryID, size_t &nBytes, bool bCollapsedHistoryWithLiveObjsOnly=false)
 Returns the size (in bytes) of either the current History with all Object versions or collapsed history with only live Objects. More...
 
WSM_EXPORT Result WSM::APISaveHistoryToBinaryFileReadOnly (const size_t nHistoryID, const char *sFilePath, const 1::vector< WSM::ObjectHistoryID > &aLayerDisplayedNegateVec={})
 Save the whole history (with all undo states) to a binary file. More...
 
WSM_EXPORT Result WSM::APISaveHistoryToBinaryStringReadOnly (const size_t nHistoryID, 1::string &sData, size_t &lastDeltaID, bool bBase64Encode, const 1::vector< WSM::ObjectHistoryID > &aLayerDisplayedNegateVec={})
 Save the whole history (with all undo states) to a binary string. More...
 
WSM_EXPORT Result WSM::APILoadHistoryFromBinaryString (const size_t nHistoryID, const 1::string &base64Str, bool base64encoded=true)
 Load the whole history (with all undo states) from an, optionally base64 encoded, string and add to to an empty History. More...
 
WSM_EXPORT Result WSM::APISaveToFileReadOnly (const size_t nHistoryID, const 1::vector< size_t > &aObjectIDs, const 1::string &sFilePath, const WSM::nFileType eFileType=WSM::nFileTypeBinaryWSM, const bool bWithChildren=true, const double dExportScale=1.0, const 1::vector< WSM::ObjectHistoryID > &aExcludedObjects={}, const 1::vector< WSM::ObjectHistoryID > &aLayerDisplayedNegateVec={})
 Save Objects to a file of the specified type. More...
 
WSM_EXPORT Result WSM::APISaveToAXMFileReadOnly (const size_t nHistoryID, const 1::vector< size_t > &aObjectIDs, const 1::string &sFilePath, 1::vector< char > const &aPreviewImage={}, bool bWithChildren=true)
 Saves Objects to an AXM file. More...
 
WSM_EXPORT Result WSM::APISaveToStringReadOnly (const size_t nHistoryID, const 1::vector< size_t > &aObjectIDs, 1::string &sOutputString, const WSM::nFileType eFileType=WSM::nFileTypeBinaryWSM, const bool bWithChildren=true, const 1::vector< WSM::ObjectHistoryID > &aExcludedObjects={}, bool bBase64Encode=false, const 1::vector< WSM::ObjectHistoryID > &aLayerDisplayedNegateVec={})
 Save Objects to a string. More...
 
WSM_EXPORT Result WSM::APISaveAllActiveObjectsToBinaryFileReadOnly (const size_t nHistoryID, const char *sFilePath)
 Save all active Objects to a binary file. More...
 
WSM_EXPORT Result WSM::APISaveDeltaToBinaryStringReadOnly (const size_t nHistoryID, 1::string &base64Str, size_t &deltaID, bool base64encode=true)
 Serialize the given (or last, if deltaID is WSM::INVALID_ID) Delta and all its changed Objects to a binary stream, optionally Base64 encoding the serialized data, and save it to a string. More...
 
WSM_EXPORT Result WSM::APILoadDeltaFromBinaryString (const size_t nHistoryID, const 1::string &serializedDeltaStr, size_t &nDeltaID, size_t &nTrailingDeltaIDShift, size_t &nFirstDiscardedDeltaID, bool base64encoded=true)
 Load Delta from the given Base64 encoded string and add it to the given History. More...
 
WSM_EXPORT Result WSM::APIDecodeBase64StringReadOnly (const 1::string &base64Str, size_t &previousDeltaID, 1::string &decodedStr)
 Decode the given base64 encoded string. More...
 
WSM_EXPORT Result WSM::APISaveLastDeltaToBinaryFileReadOnly (const size_t nHistoryID, const char *sFilePath)
 Save last Delta and all changed Objects to a binary file. More...
 
WSM_EXPORT Result WSM::APILoadDeltaFromBinaryFile (const size_t nHistoryID, const char *sFilePath)
 Load Delta from a binary file and add it to the History. More...
 
WSM_EXPORT Result WSM::APILoadFromFile (const size_t nHistoryID, const 1::string &sFilePath, const WSM::nFileType eFileType=WSM::nFileTypeBinaryWSM, ptrdiff_t *pObjectIdOffset=nullptr, const size_t nOptions=to_ut(WSM::nLoadingOptions::RemoveDuplicate| WSM::nLoadingOptions::Merge| WSM::nLoadingOptions::CreateMesh), double dMaxDistanceFromOrigin=0.0, double dScaleFactor=1.0)
 Load a model from a file of one of the supported types. More...
 
WSM_EXPORT Result WSM::APILoadFromFacets (const size_t nHistoryID, const 1::vector< FacetsBodyData > &facetsData, 1::vector< size_t > &createdObjectIDs, const size_t nOptions=to_ut(WSM::nLoadingOptions::RemoveDuplicate| WSM::nLoadingOptions::Merge| WSM::nLoadingOptions::CreateMesh), double dMaxDistanceFromOrigin=0.0, double dRemoveDuplicateTol=WSM_MACHINE_TOL)
 Load a model from specified list of body facets. More...
 
WSM_EXPORT Result WSM::APILoadFromString (const size_t nHistoryID, const 1::string &sInputString, const WSM::nFileType eFileType=WSM::nFileTypeBinaryWSM, ptrdiff_t *pObjectIdOffset=nullptr, const size_t nOptions=to_ut(WSM::nLoadingOptions::RemoveDuplicate| WSM::nLoadingOptions::Merge| WSM::nLoadingOptions::CreateMesh), double dMaxDistanceFromOrigin=0.0, bool bBase64Encoded=false, double dScaleFactor=1.0)
 Load a model from a string containing serialization of one of the supported types. More...
 
WSM_EXPORT Result WSM::APILoadAXMFile (const size_t nHistoryID, const 1::string &sFilePath, const 1::vector< 1::vector< char >> *defaultTextures=nullptr, bool isImport=false, const 1::string &logOutputPath={})
 Load an AXM file, both pre WSM and current. More...
 
WSM_EXPORT Result WSM::APILoadMaterialsFromAXMFile (const size_t nHistoryID, const 1::string &sFilePath)
 Load only materials and their textures from an AXM file into the given history. More...
 
WSM_EXPORT Result WSM::APIRayFireReadOnly (const size_t nHistoryID, const WSM::Line3d &ray, 1::vector< size_t > &aObjectIDs, double dRayRadius=WSM_MACHINE_TOL, bool bVertices=true, bool bEdges=true, bool bFaces=true, double dMaxParam=WSM_DISTANCE_BIG, 1::vector< GroupInstancePath > *pObjectsInGroupsVec=nullptr, 1::vector< WSM::Transf3d > *pGroupAggregateTransf3dVec=nullptr, 1::vector< 1::pair< double, ptrdiff_t > > *pParamIndexVec=nullptr, WSM::IRayFireFilterAndAbort *filterAndAbort=nullptr)
 Finds all live Objects of the types specified that intersect the ray with the given ray radius. More...
 
WSM_EXPORT Result WSM::APIIntersectsNegativeSideOfPlanesReadOnly (const size_t nHistoryID, const 1::vector< WSM::Plane > &aPlanes, 1::vector< size_t > &aObjectIDs, bool bVertices=true, bool bEdges=true, bool bFaces=true, bool bStrict=false, double dTol=WSM_MACHINE_TOL, const WSM::Line3d *pLine=nullptr, 1::vector< GroupInstancePath > *pObjectsInGroupsVec=nullptr, 1::vector< WSM::Transf3d > *pGroupAggregateTransf3dVec=nullptr, 1::vector< 1::pair< double, ptrdiff_t > > *pParamIndexVec=nullptr, bool bInstances=false, WSM::IRayFireFilterAndAbort *filterAndAbort=nullptr)
 Get all live Objects of the types specified that intersect the negative side of all the given Planes. More...
 
WSM_EXPORT Result WSM::APIConnectPoint3ds (size_t nHistoryID, const WSM::Point3d &pt1, const WSM::Point3d &pt2)
 Connect two Point3ds for use in 3D sketching creating Edges as appropriate, splitting Faces and Edges, creating new Faces as planar areas are enclosed, etc. More...
 
WSM_EXPORT Result WSM::APIConnectVertexAndPoint3d (size_t nHistoryID, size_t nVertexID, const WSM::Point3d &pt)
 Connect a Vertex and a Point3d for use in 3D sketching creating Edges as appropriate, splitting Faces and Edges, creating new Faces as planar areas are enclosed, etc. More...
 
WSM_EXPORT Result WSM::APIConnectVertices (size_t nHistoryID, size_t nVertexID1, size_t nVertexID2)
 Connect two Vertices for use in 3D sketching creating Edges as appropriate, splitting Faces and Edges, creating new Faces as planar areas are enclosed, etc. More...
 
WSM_EXPORT Result WSM::APIImprint (size_t nHistoryID, size_t nObject1, size_t nObject2, bool bChangeBoth=true)
 Imprints the Objects onto each other. More...
 
WSM_EXPORT Result WSM::APIImprintWithPlane (size_t nHistoryID, size_t nObject, const Plane &pla)
 Imprints the Plane onto the Object. More...
 
WSM_EXPORT Result WSM::APISlice (size_t nHistoryID, size_t nDestinationHistoryID, size_t nObject, const Plane &pla, 1::vector< size_t > &aNewNonOwnedIDs, IsObjectHiddenFunctionType isHiddenFunc=nullptr)
 Slices the Object with the Plane creating new Faces and Edges that are NOT connected to the Object. More...
 
WSM_EXPORT Result WSM::APISliceHistoryReadOnly (size_t nHistoryID, const Plane &pla, 1::vector< 1::pair< WSM::Point3d, bool >> &aPointsToConnect, IsObjectHiddenFunctionType isHiddenFunc=nullptr)
 Slices the history with the Plane creating line points. More...
 
WSM_EXPORT Result WSM::APIUnite (size_t nHistoryID, size_t nObject1, size_t nObject2, const 1::vector< size_t > &aExtraObjetsIDs=1::vector< size_t >())
 Unites the Objects, deleting nObject2 and extra objects. More...
 
WSM_EXPORT Result WSM::APISubtract (size_t nHistoryID, size_t nObject1, size_t nObject2, const 1::vector< size_t > &aExtraObjetsIDs=1::vector< size_t >())
 Subtracts nObject2 and extra objects from nObject1, deleting nObject2 and extra objects. More...
 
WSM_EXPORT Result WSM::APIUniteNonDestructive (const GroupInstancePath &blank, const 1::vector< GroupInstancePath > &tools)
 Unites the tools with the blank changing the blank while keeping the tools unaffected. More...
 
WSM_EXPORT Result WSM::APISubtractNonDestructive (const GroupInstancePath &blank, const 1::vector< GroupInstancePath > &tools)
 Subtracts the tools from the blank changing the blank while keeping the tools unaffected. More...
 
WSM_EXPORT Result WSM::APISeparate (size_t nHistoryID, size_t nBodyID, 1::vector< size_t > &aNewBodyIDs)
 If the Body has more than one Lump, makes new Bodies for each Lump after the first one. More...
 
WSM_EXPORT Result WSM::APIGetObjectNameReadOnly (size_t nHistoryID, size_t nObject, const char *&pName)
 Returns the name of the Object. More...
 
WSM_EXPORT Result WSM::APIComputeAreaReadOnly (size_t nHistoryID, size_t nObject, double &dArea, const WSM::Transf3d *pTransf3d=nullptr)
 Computes the surface area of the Object. More...
 
WSM_EXPORT Result WSM::APIComputeVolumeReadOnly (size_t nHistoryID, size_t nObject, double &dVolume, const WSM::Transf3d *pTransf3d=nullptr)
 Computes the volume of the Object. More...
 
WSM_EXPORT Result WSM::APIReverseFaces (size_t nHistoryID, const 1::vector< size_t > &aFaceIDs)
 Reverse all the Faces given by aFaceIDs. More...
 
WSM_EXPORT Result WSM::APIRegisterLockGuardFactory (const 1::function< AbstractLockGuard * > &fn)
 Note this is for internal use only and is not exposed to javascript. More...
 
WSM_EXPORT Result WSM::APIRegisterModelChangedCallbackReadOnly (FunctionType const &fCallback)
 Register a callback that will be called on the completion of each Delta or Undo/Redo operation within any non-temporary History, or upon the creation of a non-temporary history, or the deletion of any history. More...
 
WSM_EXPORT Result WSM::APIRegisterProgressCallbacksReadOnly (WSM::ApiProgress::StartCbkFn startCbk=WSM::ApiProgress::StartCbkFn{}, WSM::ApiProgress::ProgressCbkFn progressCbk=WSM::ApiProgress::ProgressCbkFn{}, WSM::ApiProgress::FinishedCbkFn finishCbk=WSM::ApiProgress::FinishedCbkFn{}, float incrP=1.0f, float startP=0.0f, float endP=100.0f)
 Register progress callback. More...
 
WSM_EXPORT Result WSM::APIGetTopLevelOwnersReadOnly (size_t nHistoryID, const size_t nObjectID, 1::vector< size_t > &aOwnerIDs)
 Returns the top level owners of the given Object. More...
 
WSM_EXPORT Result WSM::APIGetCreatedChangedAndDeletedInActiveDeltaReadOnly (size_t nHistoryID, 1::vector< size_t > *paCreated, 1::vector< size_t > *paChanged, 1::vector< size_t > *paDeleted, WSM::nObjectType nType, bool bForUndo=false)
 Gets the changed, created, and deleted objects in the most recent delta. More...
 
WSM_EXPORT Result WSM::APIGetCreatedChangedAndDeletedInDeltaRangeReadOnly (size_t nHistoryID, size_t previousDeltaID, size_t currentDeltaID, 1::vector< size_t > *paCreated, 1::vector< size_t > *paChanged, 1::vector< size_t > *paDeleted, 1::vector< WSM::nObjectType > const &aTypes)
 Gets the changed, created, and deleted objects between the previous and current Delta in the range of Deltas provided. More...
 
WSM_EXPORT Result WSM::APIGetCoedgeDirectionReadOnly (size_t nHistoryID, const size_t nObjectID, bool &bForward)
 Return true if cedge and its underlying edge go in the same direction; otherwise, return false. More...
 
WSM_EXPORT Result WSM::APIEnableJournaling (size_t nHistoryID, const 1::string &sJournalFileName={})
 Enable Journaling. More...
 
WSM_EXPORT Result WSM::APIIsJournalingReadOnly (bool &isJournaling)
 Check if Journaling is enabled. More...
 
WSM_EXPORT Result WSM::APIEnableJournalingTypes (const 1::vector< 1::string > &types, bool add=false)
 First turns off all journaling types if add is false, and then turns on all types in the given list of types. More...
 
WSM_EXPORT Result WSM::APIGetEnabledJournalingTypesReadOnly (1::set< 1::string > &types)
 Returns the list of journaling types that are enabled. More...
 
WSM_EXPORT Result WSM::APIDisableJournaling (1::string *journalOutput=nullptr)
 Disable Journaling. More...
 
WSM_EXPORT Result WSM::APISetObjectsMaterial (size_t nHistoryID, const 1::vector< size_t > &aObjectIDs, size_t nMaterialID)
 Sets the material given by MaterialID on the given Objects. More...
 
WSM_EXPORT Result WSM::APISetFaceBacksideMaterial (size_t nHistoryID, const 1::vector< size_t > &aFaceIDs, size_t nMaterialID)
 Sets the material given by MaterialID as the backside material of the given faces. More...
 
WSM_EXPORT Result WSM::APIGetObjectMaterialReadOnly (size_t nHistoryID, size_t nObjectID, size_t &nMaterialID)
 Gets the material of the object. More...
 
WSM_EXPORT Result WSM::APIGetFaceBacksideMaterialReadOnly (size_t nHistoryID, size_t nFaceID, size_t &nMaterialID)
 Gets the backside material of the given face. More...
 
WSM_EXPORT Result WSM::APIGetObjectTextureCoordinatesReadOnly (size_t nHistoryID, size_t nObjectID, 1::vector< WSM::Point2d > &aTexCoords)
 Generates texture coordinates for the given ObjectHistoryID nObjectID is a face or body, other object types will return bad input error For the case of body: Generates the texture coordinates for the facets of all faces in the body This is slightly more efficient than calling per-face APIGetTextureCoordinatesReadOnly for each face of the body. More...
 
WSM_EXPORT Result WSM::APICreateMaterial (size_t nHistoryID, const Color &nColor, double dHorizontalScale, double dVerticalScale, size_t nTextureID, size_t &nMaterialID, 1::string const &sMaterialName={}, 1::string const &sMaterialIdentifier={}, 1::vector< 1::pair< 1::string, 1::string >> const *pAdditionalRenderData=nullptr, 1::vector< 1::pair< 1::string, size_t >> const *pAdditionalTextures=nullptr)
 Creates a Material. More...
 
WSM_EXPORT Result WSM::APICreateMaterialWithTexture (size_t nHistoryID, const Color &nColor, double dHorizontalScale, double dVerticalScale, 1::vector< char > const &aBitmapData, bool bUseBitmapAlpha, size_t &nMaterialID, 1::string const &sMaterialName={}, 1::string const &sMaterialIdentifier={}, 1::vector< 1::pair< 1::string, 1::string >> const *pAdditionalRenderData=nullptr, 1::vector< 1::pair< 1::string, size_t >> const *pAdditionalTextures=nullptr, 1::string const &sTextureName={})
 Creates a Material with a texture. More...
 
WSM_EXPORT Result WSM::APISetMaterialColor (size_t nHistoryID, size_t nMaterialID, const Color &nColor)
 Sets a Material's color. More...
 
WSM_EXPORT Result WSM::APISetMaterialTexture (size_t nHistoryID, size_t nMaterialID, double dHorizontalScale, double dVerticalScale, size_t nTextureID)
 Sets a MaterialObject's texture data. More...
 
WSM_EXPORT Result WSM::APISetMaterialData (size_t nHistoryID, size_t nMaterialID, const Color &nColor, double dHorizontalScale, double dVerticalScale, size_t nTextureID, 1::string const *pMaterialName=nullptr, 1::string const *pMaterialIdentifier=nullptr, 1::vector< 1::pair< 1::string, 1::string >> const *pAdditionalRenderData=nullptr, 1::vector< 1::pair< 1::string, size_t >> const *pAdditionalTextures=nullptr)
 Sets all the data of a Material. More...
 
WSM_EXPORT Result WSM::APIGetMaterialDataReadOnly (const size_t nHistoryID, const size_t nMaterialID, Color &nColor, double &dHorizontalScale, double &dVerticalScale, size_t &nTextureID, 1::string *pMaterialName=nullptr, 1::string *pMaterialIdentifier=nullptr, 1::vector< 1::pair< 1::string, 1::string >> *pAdditionalRenderData=nullptr, 1::vector< 1::pair< 1::string, size_t >> *pAdditionalTextures=nullptr, 1::vector< size_t > *aObjectsUsingMaterial=nullptr)
 Gets the material data of a Material. More...
 
WSM_EXPORT Result WSM::APIIsMaterialUsedReadOnly (const size_t nHistoryID, const size_t nMaterialID, bool &bIsUsed)
 Returns true if the material is used by any objects. More...
 
WSM_EXPORT Result WSM::APICreateTexture (size_t nHistoryID, 1::vector< char > const &aBitmapData, bool bUseBitmapAlpha, size_t &nCreatedTextureID, 1::string const &sTextureName={})
 Creates a Texture object. More...
 
WSM_EXPORT Result WSM::APIGetTextureDataReadOnly (size_t nHistoryID, size_t nTextureID, 1::vector< char > &aBitmapData, bool &bUseBitmapAlpha, 1::string *pTextureName=nullptr)
 Returns the data of a texture. More...
 
WSM_EXPORT Result WSM::APISetTextureData (size_t nHistoryID, size_t nTextureID, 1::vector< char > const &aBitmapData, bool bUseBitmapAlpha, 1::string const *pTextureName=nullptr)
 Set the data of a Texture object. More...
 
WSM_EXPORT Result WSM::APIGetObjectAttributesReadOnly (size_t nHistoryID, size_t nObjectID, 1::vector< size_t > &aAttributeIDs)
 Get all of the Attributes of the given Object. More...
 
WSM_EXPORT Result WSM::APIGetObjectLayersReadOnly (size_t nHistoryID, size_t nObjectID, 1::vector< size_t > &aLayerIDs)
 Get all the layers of the given Object. More...
 
WSM_EXPORT Result WSM::APIIsEdgeOnCircleReadOnly (size_t nHistoryID, size_t nEdgeID, double &radius, WSM::Point3d &center, WSM::UnitVector3d &normal, WSM::UnitVector3d &xaxis, 1::vector< size_t > &aAllCircleSiblings, bool &bIsOnCircle)
 Gets the circle data of the given Edge when the Edge lies on a circle. More...
 
WSM_EXPORT Result WSM::APIEditCircleEdges (size_t nHistoryID, 1::vector< size_t > nEdgeIDs, double radius, const WSM::Point3d &center, const WSM::UnitVector3d &normal, const WSM::UnitVector3d &xaxis, double angle=0.0)
 Edits the circle data of the Edges with nEdgeIDs when the Edges lies on a circle. More...
 
WSM_EXPORT Result WSM::APIIsEdgeOnSplineReadOnly (size_t nHistoryID, size_t nEdgeID, 1::vector< WSM::Point3d > &aControlPoints, bool &bClosed, WSM::Vector3d &startTangent, WSM::Vector3d &endTangent, 1::vector< size_t > &aAllSplineSiblings, bool &bIsOnSpline)
 Gets the spline data of the given Edge when the Edge lies on a spline. More...
 
WSM_EXPORT Result WSM::APIEditSplineEdges (size_t nHistoryID, 1::vector< size_t > nEdgeIDs, const 1::vector< WSM::Point3d > &aControlPoints, bool bClosed, const WSM::Vector3d &startTangent, const WSM::Vector3d &endTangent)
 Edit the spline data of the Edge with nEdgeIDs when the Edge lies on a spline. More...
 
WSM_EXPORT Result WSM::APIIsFaceOnCylinderReadOnly (size_t nHistoryID, size_t nFaceID, double &radius, WSM::Point3d &center, WSM::UnitVector3d &normal, WSM::UnitVector3d &xaxis, 1::vector< size_t > &aAllCylinderSiblings, bool &bIsOnCylinder)
 Gets the Cylinder data of the given Face when the Face lies on a cylinder. More...
 
WSM_EXPORT Result WSM::APIEditCylinderFaces (size_t nHistoryID, 1::vector< size_t > nFaceIDs, double radius, const WSM::Point3d &center, const WSM::UnitVector3d &normal, const WSM::UnitVector3d &xaxis)
 Edits the Cylinder data of the given Faces when the Faces lies on a cylinder. More...
 
WSM_EXPORT Result WSM::APIIsFaceOnSphereReadOnly (size_t nHistoryID, size_t nFaceID, double &radius, WSM::Point3d &center, WSM::UnitVector3d &normal, WSM::UnitVector3d &xaxis, 1::vector< size_t > &aAllSphereSiblings, bool &bIsOnSphere)
 Gets the Sphere data of the given Face when the Face lies on a sphere. More...
 
WSM_EXPORT Result WSM::APIEditSphereFaces (size_t nHistoryID, 1::vector< size_t > nFaceIDs, double radius, const WSM::Point3d &center, const WSM::UnitVector3d &normal, const WSM::UnitVector3d &xaxis)
 Edits the Sphere data of the given Faces when the Faces lies on a sphere. More...
 
WSM_EXPORT Result WSM::APIIsFaceOnExtrudeReadOnly (size_t nHistoryID, size_t nFaceID, WSM::Point3d &base, WSM::Vector3d &axis, WSM::UnitVector3d &xaxis, 1::vector< WSM::Point3d > &aControlPoints, bool &bClosed, WSM::Vector3d &startTangent, WSM::Vector3d &endTangent, 1::vector< size_t > &aAllExtrudeSiblings, bool &bIsOnExtrude)
 Gets the Extrude data of the given Face when the Face lies on a Extrude. More...
 
WSM_EXPORT Result WSM::APIIsFaceOnBlendReadOnly (size_t nHistoryID, size_t nFaceID, double &radius, 1::vector< WSM::Point3d > &aPathPoints, 1::vector< size_t > &aAllBlendSiblings, bool &bIsOnBlend)
 Gets the blend data of the given Face when the Face lies on a blend. More...
 
WSM_EXPORT Result WSM::APISetObjectProperties (const size_t nHistoryID, const size_t nObjectID, const 1::string &sObjectName, bool bReportAreaByLevel, const 1::vector< size_t > *pDefaultLevelIDs=nullptr)
 Sets the properties of a given object (Body): A name and if that particular body reports its area by level or not, and the optional default levelIDs associated with the object. More...
 
WSM_EXPORT Result WSM::APIGetObjectPropertiesReadOnly (const size_t nHistoryID, const size_t nObjectID, 1::string &sObjectName, bool &bReportAreaByLevel)
 Gets the properties of a given object (Body): A name and if that particular body reports its area by level or not. More...
 
WSM_EXPORT Result WSM::APICreateLevelObjects (const size_t nHistoryID, const 1::vector< 1::pair< 1::string, double > > &aLevelsData, 1::vector< size_t > &aLevelIDs)
 Creates Level objects with the data provided by aLevelsData. More...
 
WSM_EXPORT Result WSM::APISetLevelsData (const size_t nHistoryID, const 1::vector< size_t > &aLevelIDs, const 1::vector< 1::pair< 1::string, double > > &aLevelsData)
 Sets the data in the Levels to the name, elevation pairs in aLevelData. More...
 
WSM_EXPORT Result WSM::APISetObjectsLevels (const size_t nHistoryID, const 1::vector< size_t > &aObjectIDs, const 1::vector< size_t > &aLevelsIDs)
 Set the levels associated with a list of objects (bodies) Empty list "clear levels from object". More...
 
WSM_EXPORT Result WSM::APIGetLevelDataReadOnly (const size_t nHistoryID, const size_t nLevelID, 1::string &sLevelName, double &dElevation)
 Gets the Level´s data. More...
 
WSM_EXPORT Result WSM::APIGetObjectLevelsReadOnly (const size_t nHistoryID, const size_t nObjectID, 1::vector< size_t > &aLevelsIDs)
 Get the levels associated with an object (body) More...
 
WSM_EXPORT Result WSM::APISetLocalCoordinateSystem (const size_t nHistoryID, const Transf3d &LCS)
 Set the LCS (local coordinate system) of the given History. More...
 
WSM_EXPORT Result WSM::APIGetLocalCoordinateSystemReadOnly (const size_t nHistoryID, Transf3d &LCS)
 Get the LCS (local coordinate system) of the given History. More...
 
WSM_EXPORT Result WSM::APIIsObjectLiveReadOnly (size_t nHistoryID, size_t nObjectID, bool &bIsLive)
 Find out if nObjectID is live or dead in nHistoryID. More...
 
WSM_EXPORT Result WSM::APIIsHistoryLiveReadOnly (size_t nHistoryID, bool &bIsLive)
 Find out if nHistoryID is live or dead. More...
 
WSM_EXPORT Result WSM::APIIsEdgeMergeableReadOnly (size_t nHistoryID, size_t nEdgeID, bool &bIsMergeable, bool bUseMaterial=false)
 Find out if an Edge is mergeable. More...
 
WSM_EXPORT Result WSM::APICreateImageObject (const size_t nHistoryID, const 1::string &sName, const size_t nTextureID, const float fAlphaValue, const bool bFeaturesVisible, const 1::array< WSM::Point3d, 4 > &aCorners, size_t &nObjectID)
 Creates an image object. More...
 
WSM_EXPORT Result WSM::APICreateImageObjectWithTexture (const size_t nHistoryID, const 1::string &sName, const float fAlphaValue, const bool bFeaturesVisible, const 1::array< WSM::Point3d, 4 > &aCorners, 1::vector< char > const &aBitmapData, size_t &nObjectID, 1::string const &sTextureName={})
 Creates an image object with texture.The image is connected to an internal texture object. More...
 
WSM_EXPORT Result WSM::APICreateSatelliteImageObject (const size_t nHistoryID, const 1::string &sName, const size_t nTextureID, const float fAlphaValue, const bool bFeaturesVisible, const 1::array< WSM::Point3d, 4 > &aCorners, const WSM::Vector2d &coordinates, const WSM::Vector2d &coordinatesSpan, const 1::array< size_t, 2 > &aPixelDimensions, size_t &nObjectID)
 Creates a satellite image object. More...
 
WSM_EXPORT Result WSM::APIMoveImage (const size_t nHistoryID, const size_t nImageID, const int nShift)
 This call alters the spatial order of images along the z (vertical) axis. More...
 
WSM_EXPORT Result WSM::APISetImageData (const size_t nHistoryID, const size_t nImageID, const 1::string &sName, const size_t nTextureID, const float fAlphaValue, const bool bFeaturesVisible, const 1::array< WSM::Point3d, 4 > &aCorners)
 Sets the image object data. More...
 
WSM_EXPORT Result WSM::APISetSatelliteData (const size_t nHistoryID, const size_t nImageID, const WSM::Vector2d &coordinates, const WSM::Vector2d &coordinatesSpan, const 1::array< size_t, 2 > &aPixelDimensions)
 Sets satellite data to an image object. More...
 
WSM_EXPORT Result WSM::APIRemoveSatelliteData (const size_t nHistoryID, const size_t nImageID)
 Removes the satellite data associated with a given image. More...
 
WSM_EXPORT Result WSM::APIGetImageDataReadOnly (const size_t nHistoryID, const size_t nImageID, 1::string &sName, size_t &nTextureID, size_t &nPosition, float &fAlphaValue, bool &bFeaturesVisible, 1::array< WSM::Point3d, 4 > &aCorners, bool &bHasSatelliteData)
 Gets the image data. More...
 
WSM_EXPORT Result WSM::APIGetSatelliteDataReadOnly (const size_t nHistoryID, const size_t nImageID, WSM::Vector2d &coordinates, WSM::Vector2d &coordinatesSpan, 1::array< size_t, 2 > &aPixelDimensions)
 Gets the satellite data associated with a given image. More...
 
WSM_EXPORT Result WSM::APICreateGroup (size_t nHistoryID, const 1::vector< size_t > &aObjectIDs, size_t &nCreatedGroupID, const 1::vector< WSM::Transf3d > *pInstanceTransforms=nullptr, size_t nReferencedHistory=WSM::INVALID_ID, WSM::Transf3d const *pGeometryTransform=nullptr)
 Creates a Group with the given aObjectIDs, which are removed from nHistoryID. More...
 
WSM_EXPORT Result WSM::APIGetGroupReferencedHistoryReadOnly (size_t nHistoryID, size_t nGroupOrInstanceID, size_t &nReferencedHistoryID, bool bDeletedInstanceOK=false, int nDeltaOffset=0)
 Returns the ID of the Group's or Instance's referenced History. More...
 
WSM_EXPORT Result WSM::APIGetInstanceTransf3dReadOnly (size_t nHistoryID, size_t nInstanceID, WSM::Transf3d &rTransf3d)
 Returns the Instance's Transf3d. More...
 
WSM_EXPORT Result WSM::APIGetAllAggregateTransf3dsReadOnly (size_t nReferencedHistoryID, size_t nTopMostHistoryID, 1::vector< WSM::Transf3d > &aGroupAggregateTransf3dVec, 1::vector< GroupInstancePath > &aTransformPaths)
 Computes all the global Transf3ds on the given History referenced by a Group stopping at nTopMostHistoryID. More...
 
WSM_EXPORT Result WSM::APIFlattenGroupsOrInstances (size_t nHistoryID, 1::vector< size_t > const &aGroupOrInstanceIDs, bool bRecursive, bool bImprint)
 Replace the instances and/or groups referenced in aGroupOrInstanceIDs by a copy of the contents of the referenced history. More...
 
WSM_EXPORT Result WSM::APIAddInstancesToGroup (size_t nHistoryID, size_t nGroupID, 1::vector< Transf3d > const &aTransforms, 1::vector< size_t > &aNewInstanceIDs)
 Creates new instances in the specified group and returns their IDs. More...
 
WSM_EXPORT Result WSM::APICreateSeparateHistoriesForInstances (size_t nHistoryID, 1::vector< size_t > const &aInstanceIDs, bool bNewGroupPerInstance, 1::vector< size_t > &aNewGroupIDs)
 Creates new copies of the existing groups and the referenced histories for the specified instances. More...
 
WSM_EXPORT Result WSM::APISetDeltaFlags (size_t nHistoryID, size_t nDeltaID, size_t nDeltaFlags)
 Set flags of Delta with ID of nDeltaID in History nHistoryID. More...
 
WSM_EXPORT Result WSM::APISetAllDeltaFlags (size_t nHistoryID, size_t nOnFlags, size_t nOffFlags=0, bool bRecursively=true)
 Set flags of all Deltas in History nHistoryID and, optionally, recursively in all Deltas in referenced histories. More...
 
WSM_EXPORT Result WSM::APIGetDeltaFlagsReadOnly (size_t nHistoryID, size_t nDeltaID, size_t &nDeltaFlags)
 Get flags of Delta with ID of nDeltaID in History nHistoryID. More...
 
WSM_EXPORT Result WSM::APISweep (size_t nHistoryID, const 1::vector< WSM::GroupInstancePath > &aProfile, const 1::vector< WSM::GroupInstancePath > &aPath, bool bRemoveUnusedProfileAndPath=false)
 Creates surface by sweeping the profile along the path. More...
 
WSM_EXPORT Result WSM::APIGetPointsFromObjectIDsReadOnly (size_t nHistoryID, const 1::vector< size_t > &aIDs, 1::vector< size_t > &aVertices, WSM::Point3d *pCOG=nullptr, WSM::Plane *pPlane=nullptr)
 Helper function used in sweeping to get points from the profile or path Objects. More...
 
WSM_EXPORT Result WSM::APIOffset3d (size_t nHistoryID, size_t nObjectID, double dOffsetDistance)
 Offsets all the Faces in the given Object by the amount specified. More...
 
WSM_EXPORT Result WSM::APIShell (size_t nHistoryID, size_t nBodyID, double dOffsetDistance, const 1::vector< size_t > *paOpenFaceIDs=nullptr)
 Shells a Body by the specified offset. More...
 
WSM_EXPORT Result WSM::APIBlend (size_t nHistoryID, double dRadius, const 1::vector< size_t > &aPathIDs, const double accuracyORcount=6.0, size_t nMinimumNumberOfFacets=0)
 Creates a blend surface using the Edges given by aPathIDs. More...
 
WSM_EXPORT Result WSM::APICover (size_t nHistoryID, const 1::vector< size_t > &aEdgeIDs, bool bMerge=false)
 Makes Faces that cover a closed circuit of Edges. More...
 
WSM_EXPORT Result WSM::APILoft (size_t nHistoryID, const 1::vector< 1::vector< size_t >> &aaProfileIDs, bool bDeleteInteriorProfileFaces=false)
 Makes Faces that connect a vector of profiles. More...
 
WSM_EXPORT Result WSM::APIExtrudeEdges (size_t nHistoryID, const 1::vector< size_t > &aEdgeIDs, const WSM::Transf3d &t)
 Makes a Face from the given set of continuous edges and a transformed copy of the edges. More...
 
WSM_EXPORT Result WSM::APIGetEdgePointsReadOnly (size_t nHistoryID, size_t nEdgeID, WSM::Point3d &start, WSM::Point3d &end)
 Get edge endpoints directly. More...
 
WSM_EXPORT Result WSM::APIGetRenderableFaceReadOnly (const size_t nHistoryID, const size_t nFaceID, bool bCalculateTexCoords, 1::vector< WSM::Point3d > &vertices, 1::vector< WSM::UnitVector3d > &normals, 1::vector< WSM::Point2d > &texCoords, bool bBackSide=false)
 Returns vertices in groups of 3 (triangles), with associated normals and optionally texture coordinates. More...
 
WSM_EXPORT Result WSM::APISetFaceUVDataAttributes (const size_t nHistoryID, const 1::vector< size_t > &aFaceIDs, const WSM::Transf3d &rTransf3d=WSM::Transf3d::kIdentity, bool bReplaceTransform=false, const WSM::Point3d *tformCenter=nullptr, const WSM::Point2d *tformUVCenter=nullptr)
 Sets FaceUVDataAttributes on the faces passed in and applies a transform to them. More...
 
WSM_EXPORT Result WSM::APIGetFaceUVDataTransformReadOnly (const size_t nHistoryID, const size_t nFaceID, WSM::Transf3d &rTransf3d, WSM::Transf3d *planeTransf3d=nullptr, bool bBackSide=false)
 Gets the 2d transform, returned as a 3d transform, for the uvs on the given Face. More...
 
WSM_EXPORT Result WSM::APIGetFaceUVDataAttributeUVsReadOnly (const size_t nHistoryID, const size_t nFaceUVDataAttributeID, 1::vector< Point2d > &aFrontUVs, 1::vector< Point2d > &aBackUVs, 1::vector< size_t > *pVertexIDs=nullptr)
 Gets the UVs from a FaceUVDataAttribute. More...
 
WSM_EXPORT Result WSM::APICompareHistoryReadOnly (size_t nHistoryID, size_t nActiveDeltaIdx, const 1::vector< size_t > &aDeltaIDs, nHistoryComparison &nComparisonResult)
 Compare nHistoryID with parameters of collaboration server's History, which contains only "accepted" Deltas. More...
 
WSM_EXPORT Result WSM::APIIsHistoryNonTemporaryReadOnly (size_t nHistoryID, bool &bIsNonTemporary)
 Returns whether a history is temporary or not. More...
 
WSM_EXPORT Result WSM::APIChangeHistoryID (size_t &nHistoryIDtoChange)
 Change ID of a History, nHistoryIDtoChange, and reset it everywhere the old ID was referenced: in Objects belonging to the History being modified as well as in Groups referencing it. More...
 
WSM_EXPORT Result WSM::APICreateLayer (size_t nHistoryID, 1::string const &name, bool bDisplayed, size_t &nLayerID)
 Create a layer object with a given name and display flag. More...
 
WSM_EXPORT Result WSM::APIGetLayerDataReadOnly (size_t nHistoryID, size_t nLayerID, 1::string &name, bool &bDisplayed, 1::vector< size_t > *aObjectsUsingLayer=nullptr)
 Get the data from a layer. More...
 
WSM_EXPORT Result WSM::APISetLayerData (size_t nHistoryID, size_t nLayerID, 1::string const &name, bool bDisplayed)
 Set the data of a layer. More...
 
WSM_EXPORT Result WSM::APISetLayersDisplayed (size_t nHistoryID, 1::vector< size_t > const &aLayerIDs, bool bDisplayed)
 Set the display flag of layers without affecting the other data. More...
 
WSM_EXPORT Result WSM::APIAddObjectsLayers (size_t nHistoryID, 1::vector< size_t > const &aLayerIDs, 1::vector< size_t > const &aObjectIDs)
 Add layers to objects. More...
 
WSM_EXPORT Result WSM::APIRemoveObjectsLayers (size_t nHistoryID, 1::vector< size_t > const &aLayerIDs, 1::vector< size_t > const &aObjectIDs)
 Remove layers from objects. More...
 
WSM_EXPORT Result WSM::APIAddRemoveObjectsLayers (size_t nHistoryID, 1::vector< size_t > const &aLayerAddIDs, 1::vector< size_t > const &aLayerRemoveIDs, 1::vector< size_t > const &aObjectIDs)
 Add layers to and remove layers from objects in a single operation. More...
 
WSM_EXPORT Result WSM::APICreateGeometryFromData (size_t nHistoryID, 1::vector< TextureData > const &aTextures, 1::vector< MaterialData > const &aMaterials, 1::vector< LayerData > const &aLayers, 1::vector< InstanceData > const &aInstances, 1::vector< 1::vector< FaceData >> const &aFaceCollections, 1::vector< EdgeData > const &aEdges, 1::vector< CurveData > const &aCurves, 1::vector< ImageData > const &aImages, const 1::string &aGroupName={}, bool bCreateMesh=false)
 APICreateGeometryFromData function. More...
 
WSM_EXPORT Result WSM::APICreateEdgesFromData (size_t nHistoryID, size_t &nCreatedGroupID, 1::vector< LayerData > const &aLayers, 1::vector< EdgeData > const &aEdges, 1::vector< CurveData > const &aCurves, bool bCreateMesh=true, const double accuracyORcount=10.0)
 Load a set of edges from vectors of various data in a single delta. More...
 
WSM_EXPORT Result WSM::APIGetRevitFamilyInformationReadOnly (size_t nHistoryID, bool &bIsGeneratedFromRFA, bool &bIsGeneratedFromBuiltinRFA, 1::string &familyCategory, 1::string &familyReference, 1::string &familyType, 1::string &familyExtraData)
 Get Revit Family information of the specific history. More...
 
WSM_EXPORT Result WSM::APISetRevitFamilyInformation (size_t nHistoryID, bool bIsGeneratedFromRFA, bool bIsGeneratedFromBuiltinRFA, const 1::string &familyCategory, const 1::string &familyReference, const 1::string &familyType, const 1::string &familyExtraData)
 Set Revit Family information for the specific history. More...
 
WSM_EXPORT Result WSM::APIGetEdgeStyleReadOnly (size_t nHistoryID, size_t nObjectID, Color &nColor)
 Get the style of an edge. More...
 
WSM_EXPORT Result WSM::APISetEdgesStyle (size_t nHistoryID, 1::vector< size_t > const &aObjectIDs, const Color &nColor)
 Set the style of edges on given objects. More...
 
WSM_EXPORT Result WSM::APIDebugObjectReadOnly (size_t nHistoryID, size_t nObjectID, 1::string &output)
 Given an object ID, dump debugging information to 'output'. More...
 
WSM_EXPORT Result WSM::APIIsExactMatchReadOnly (size_t nHistoryID1, size_t nHistoryID2, bool &bIsExact, size_t nObjectID1=WSM::INVALID_ID, size_t nObjectID2=WSM::INVALID_ID)
 API compares either two Histories or two Objects and sets bIsExact to true when they match exactly. More...
 
WSM_EXPORT Result WSM::APIGetDynamoModelInformationReadOnly (size_t nHistoryID, 1::string &id, 1::string *name=nullptr, 1::string *config=nullptr, 1::string *delta=nullptr)
 Get Dynamo Model information of the specific history. More...
 
WSM_EXPORT Result WSM::APISetDynamoModelInformation (size_t nHistoryID, const 1::string *id=nullptr, const 1::string *name=nullptr, const 1::string *config=nullptr, const 1::string *delta=nullptr)
 Set Dynamo Model information for the specific history. More...
 
WSM_EXPORT Result WSM::APICreateStringAttribute (size_t nHistoryID, const 1::string &sKey, const 1::string &sValue, const 1::vector< size_t > &aObjIDs, size_t &nStringAttributeID, WSM::nCopyBehavior nCB=WSM::nCopyBehavior::nShareOrCopy, bool bIsSharedOnSplit=true)
 Create a StringAttribute optionally attaching it to the given Objects. More...
 
WSM_EXPORT Result WSM::APIGetStringAttributeKeyValueReadOnly (size_t nHistoryID, size_t nStringAttributeID, 1::string &sKey, 1::string &sValue, 1::vector< size_t > &aOwnerIDs)
 Gets the key and value strings from a StringAttribute. More...
 
WSM_EXPORT Result WSM::APISetStringAttributeValue (size_t nHistoryID, size_t nStringAttributeID, const 1::string &sValue)
 Sets the value string of a StringAttribute. More...
 
WSM_EXPORT Result WSM::APIGetStringAttributesByKeyReadOnly (const size_t nHistoryID, const size_t nObjectID, const 1::string &sKey, 1::vector< size_t > &aStringAttributeIDs)
 Returns all StringAttributes attached to the Object given by nObjectID with key matching sKey. More...
 
WSM_EXPORT Result WSM::APICleanModel (size_t nHistoryID, double dEdgeTol=0.0, 1::vector< size_t > *paChangedHistories=nullptr)
 Changes the model fixing errors and getting rid of undesired features. More...
 
WSM_EXPORT Result WSM::APISplitAtNonManifoldEdgesAndVertices (size_t nHistoryID, 1::vector< size_t > *paChangedHistories=nullptr)
 Changes the model so that every edge on more than two faces and every vertex with more than one edge group is modified so that these conditions no longer occur. More...
 
WSM_EXPORT Result WSM::APICreateMesh (size_t nHistoryID, size_t &nMeshID, const 1::vector< float > &aPoints, const 1::vector< uint32_t > &aTriangles, const 1::vector< float > &aNormals={}, const 1::vector< float > &aUVs={}, const 1::vector< WSM::Color > &aColors={})
 Creates a Mesh in the History given by nHistoryID. More...
 
WSM_EXPORT Result WSM::APIGetMeshDataReadOnly (size_t nHistoryID, size_t nMeshID, 1::vector< float > &aPoints, 1::vector< uint32_t > &aTriangles, 1::vector< float > *pNormals=nullptr, 1::vector< float > *pUVs=nullptr, 1::vector< WSM::Color > *pColors=nullptr)
 Returns all the data from a Mesh. More...
 
WSM_EXPORT Result WSM::APIComputeSharedMeshDataReadOnly (size_t nHistoryID, size_t nMeshID, 1::vector< float > &aPoints, 1::vector< uint32_t > &aTriangles, 1::vector< float > &aNormals, 1::vector< uint32_t > *paUVTriangles=nullptr, 1::vector< float > *paUVs=nullptr, 1::vector< uint32_t > *paEdges=nullptr, double dCosSmoothAngle=0.86602540378443864676372317075294)
 Returns the point, normal, and triangle data from a Mesh shared so that indices with equal points and normals are reused. More...
 
WSM_EXPORT Result WSM::APIIsMeshManifoldReadOnly (const size_t nHistoryID, const size_t nMeshID, bool &bIsManifold)
 Returns true when the mesh is the boundary of a solid. More...
 
WSM_EXPORT Result WSM::APIMeshContainsPointReadOnly (const size_t nHistoryID, const size_t nMeshID, const Point3d &point, bool &bContainsPoint, WSM::UnitVector3d &normal, 1::vector< WSM::Point3d > *pTrianglePts=nullptr)
 Does the given Mesh contain the given Point3d? If so, return true and the normal at the point. More...
 
WSM_EXPORT Result WSM::APIMeshPointOnOrInsideIfManifoldReadOnly (const size_t nHistoryID, const size_t nMeshID, const Point3d &point, bool &bPointOnOrInside)
 Return true if the given point is on the Mesh. More...
 
WSM_EXPORT Result WSM::APIMeshComputeSilhouetteEdgesReadOnly (const size_t nHistoryID, const size_t nMeshID, const WSM::Point3d &cameraPos, const WSM::Vector3d &cameraDir, bool bPerspectiveView, 1::vector< uint32_t > &aSilhouettes)
 Returns silhouette edges from the Mesh. More...
 
WSM_EXPORT Result WSM::APIMeshComputeNonSmoothEdgesReadOnly (const size_t nHistoryID, const size_t nMeshID, 1::vector< uint32_t > &aEdges, double dCosSmoothAngle=0.86602540378443864676372317075294)
 Returns edges from the Mesh. More...
 
WSM_EXPORT Result WSM::APIConvertMeshesToObjects (size_t nHistoryID, const 1::vector< size_t > &aMeshIDs, 1::vector< size_t > &aCreatedObjectIDs, double dCosSmoothAngle=-1.0, bool bFlatten=false)
 Converts Meshes into Bodies with triangular Faces. More...
 
WSM_EXPORT Result WSM::APILinkMeshesForConversion (size_t nHistoryID, const 1::vector< size_t > &aMeshIDs)
 Link the Meshes with a shared string Attribute. More...
 
WSM_EXPORT Result WSM::APIConvertObjectsToMeshes (size_t nHistoryID, const 1::vector< size_t > &aObjectIDs, 1::vector< size_t > &aCreatedMeshIDs)
 Converts non-Mesh Objects into Meshes with one Mesh per Material used. More...
 
WSM_EXPORT Result WSM::APICreateVertex (const size_t nHistoryID, const WSM::Point3d &pos, size_t &nCreatedObjectID)
 Create a Vertex with the given position. More...
 
WSM_EXPORT Result WSM::APIFlattenFaces (size_t nHistoryID, const 1::vector< size_t > &aFaceIDs, double dTol=WSM_DISTANCE_TOL)
 Flattens all Faces given by aFaceIDs onto the plane of the first Face when all Faces lie within dTol of the first Face's plane, then merges into a single Face. More...
 
WSM_EXPORT Result WSM::APISaveDeltaToSolidDefReadOnly (size_t nHistoryID, 1::vector< 1::string > &aChangedDeletedTop, 1::vector< 1::string > &aChangedDeletedGeom, 1::string &jsonStr, bool bForUndo=false)
 Gets the changed, created, and deleted objects in the most recent delta and encodes this information in a solid-def JSON string so that solid-def stored in HFDM can be kept up to date. More...
 
WSM_EXPORT Result WSM::APIAddSolidDefGuids (size_t nHistoryID, const 1::vector< size_t > &aObjectIDs)
 Adds solid-def guids in StringAttributes to the given Objects. More...
 
WSM_EXPORT Result WSM::APICreateLineMesh (size_t nHistoryID, size_t &nLineMeshID, const 1::vector< float > &aPoints, const 1::vector< uint32_t > &aIndices, const 1::vector< uint32_t > &aCounts)
 Creates a LineMesh in the History given by nHistoryID. More...
 
WSM_EXPORT Result WSM::APIGetLineMeshDataReadOnly (size_t nHistoryID, size_t nLineMeshID, 1::vector< float > &aPoints, 1::vector< uint32_t > &aIndices, 1::vector< uint32_t > &aCounts)
 Returns all the data from a LineMesh. More...
 
WSM_EXPORT Result WSM::APILineMeshContainsPointReadOnly (const size_t nHistoryID, const size_t nLineMeshID, const Point3d &point, bool &bContainsPoint)
 Does the given LineMesh contain the given Point3d? If so, return true. More...
 
WSM_EXPORT Result WSM::APILineMeshGetPointsOnNegativeSideOfPlanesReadOnly (const size_t nHistoryID, const size_t nLineMeshID, const 1::vector< Plane > &aPlanes, const Line3d &line, 1::vector< Point3d > &aPoints, double dTol=WSM_MACHINE_TOL, 1::vector< 1::pair< Point3d, Point3d >> *pSegments=nullptr)
 Get all points nearest the given line from segments of the LineMesh that lie on the negative side of all the given Planes. More...
 
WSM_EXPORT Result WSM::APICreatePointMesh (size_t nHistoryID, size_t &nPointMeshID, const 1::vector< float > &aPoints)
 Creates a PointMesh in the History given by nHistoryID. More...
 
WSM_EXPORT Result WSM::APIGetPointMeshDataReadOnly (size_t nHistoryID, size_t nPointMeshID, 1::vector< float > &aPoints)
 Returns all the data from a PointMesh. More...
 
WSM_EXPORT Result WSM::APIPointMeshContainsPointReadOnly (const size_t nHistoryID, const size_t nPointMeshID, const Point3d &point, bool &bContainsPoint)
 Does the given PointMesh contain the given Point3d? If so, return true. More...
 
WSM_EXPORT Result WSM::APIPointMeshGetPointsOnNegativeSideOfPlanesReadOnly (const size_t nHistoryID, const size_t nPointMeshID, const 1::vector< Plane > &aPlanes, 1::vector< Point3d > &aPoints, double dTol=WSM_MACHINE_TOL)
 Get all points of the PointMesh that lie on the negative side of all the given Planes. More...
 
WSM_EXPORT Result WSM::APIPushBadTransformationsOntoGeometry (size_t nHistID, 1::function< bool(const WSM::Transf3d &) > isTransfGood)
 Pushes bad Instance transformations onto the underlying geometry sharing referenced Histories as much as possible. More...
 
WSM_EXPORT Result WSM::APICheckMassesCollideReadOnly (size_t nHistoryID, bool &bCollisionDetected)
 Returns true if bodies that enclose volume (possibly in instances) touch or overlap. More...
 

Variables

const size_t WSM::UNUSED_INDEX = size_t(-1)
 Used in texture, material or layer indices to indicate an unused value. More...
 
const size_t WSM::INVALID_SIZE = (1::numeric_limits<size_t>::max)()
 
const size_t WSM::INVALID_ID = (1::numeric_limits<size_t>::max)()
 
const size_t WSM::INVALID_IDx32 = 0xFFFFFFFF
 

WSM file versions

const size_t WSM::ATTRIBUTE_FILE_VERSION = 2
 The version where Attributes where added. More...
 
const size_t WSM::CORRECTBODYBOX_FILE_VERSION = 3
 Body box cannot be trusted in previous versions. More...
 
const size_t WSM::TEXTURE_FILE_VERSION = 4
 The version where textures were added. More...
 
const size_t WSM::TEXTURE_PNG_FILE_VERSION = 5
 The version where textures are blessed to be in PNG format. More...
 
const size_t WSM::XAXIS_FILE_VERSION = 6
 The version where the X axis was added to the geometry attributes. More...
 
const size_t WSM::PREVDELTAID0_FILE_VERSION = 7
 The version where prevDeltaID of the 1st Delta in History is 0 and not -1. More...
 
const size_t WSM::GROUP_FILE_VERSION = 8
 The version where Groups were added. More...
 
const size_t WSM::HEADERSIZE_FILE_VERSION = 9
 The version where binary header size was added. More...
 
const size_t WSM::DELTAFLAGS_FILE_VERSION = 9
 The version where Delta flags were added. More...
 
const size_t WSM::LAYER_FILE_VERSION = 10
 The version where Layer and LayerAttribute were added. More...
 
const size_t WSM::REVITFAMILYINFORMATION_FILE_VERSION = 11
 The version where RevitFamilyInformation were added. More...
 
const size_t WSM::FACEUVDATA_FILE_VERSION = 12
 The version where FaceUVDataAttribute was added. More...
 
const size_t WSM::EDGESTYLE_FILE_VERSION = 12
 The version where EdgeStyleAttribute was added. More...
 
const size_t WSM::MATERIAL_DATA_VERSION = 12
 The version where Material and Texture names and Protein material values were added. More...
 
const size_t WSM::SKETCHPROPERTIES_LCS_VERSION = 13
 The version where SketchProperties changed from using a double for grid rotation to a Transf3d for the local coordinate system. More...
 
const size_t WSM::MATERIAL_ATTR_BACK_FACE_VERSION = 14
 The version where MaterialAttribute added a back face flag. More...
 
const size_t WSM::FIXEDLEVELANDLAYERATTR_VERSION = 15
 The version where files no longer contain level attributes, whose level owner does not contain the attribute. More...
 
const size_t WSM::BLENDATTRIBUTE_VERSION = 16
 The version where BlendAttributes were added. More...
 
const size_t WSM::GENERATEDGEOMETRYINFORMATION_VERSION = 17
 The version where GeneratedGeometryInformation were added. More...
 
const size_t WSM::STRINGATTRIBUTE_VERSION = 18
 The version where string Attributes were added. More...
 
const size_t WSM::MESH_VERSION = 19
 The version where Mesh object was added. More...
 
const size_t WSM::MESH_COLOR_VERSION = 20
 The version where Mesh vertex colors were added. More...
 
const size_t WSM::LINE_AND_POINT_MESH = 21
 The version where Line and Point Meshes were added. More...
 
const size_t WSM::MESH_HIDDEN_EDGES_VERSION = 22
 The version where Mesh hidden lines were added. More...
 
const size_t WSM::SHARED_BITMAPS = 23
 The version where bitmap sharing for Textures across Histories was added. More...
 
const size_t WSM::SOFTWAREVERSIONx100 = 23
 "7" means "Version 0.07" This needs to be the same as the last version above More...
 

AXM file versions

const size_t WSM::AXM_VERSION_WITH_FORWARD_COMPATIBILITY = 20
 Increase the file version to keep track of changes to the format, which remain forward compatible (i.e. More...
 
const size_t WSM::AXM_VERSION_WITH_UNDO_MANAGER = 21
 First AXM version with undo manager. More...
 
const size_t WSM::AXM_VERSION_WITH_MATERIAL_MANAGER = 22
 First AXM version with material manager. More...
 
const size_t WSM::AXM_VERSION_WSM_LAYER_DISPLAY = 23
 First AXM version where the Layer display information in the WSM block is set to match the Layer block. More...
 
const size_t WSM::AXM_VERSION_WITH_MATERIAL_PREVIEW = 24
 First AXM version with material preview images. More...
 
const size_t WSM::AXM_VERSION_WITH_SECTIONPLANE_RENDER_OPTS = 25
 First AXM version with section plane rendering options. More...
 
const size_t WSM::AXM_VERSION_WITH_BRIGHTNESS_SETTINGS = 26
 First AXM version with brightness/shader settings. More...
 
const size_t WSM::AXM_VERSION_WITH_ENV_SETTINGS = 27
 First AXM version with env settings. More...
 
const size_t WSM::AXM_VERSION_FOR_WSM22 = 28
 AXM version update to reflect WSM version 22. More...
 
const size_t WSM::AXM_VERSION_WITH_AMBIENT_CONTRAST = 29
 AXM version that contains the ambient contrast rendering setting. More...
 
const size_t WSM::AXM_VERSION_FOR_WSM23 = 30
 AXM version update to reflect WSM version 23. More...
 
const size_t WSM::AXM_VERSION_LAYER_PICKABLE = 31
 AXM version where a pickable flag was added to formit layers. More...
 
const size_t WSM::AXM_VERSION_TRANSPARENT_GROUND = 32
 AXM version where ground transparency was added. More...
 
const size_t WSM::AXM_MAJOR_FILE_VERSION = 32
 The current major file version for the AXM format This needs to be the same as the last AXM file version above. More...
 
const size_t WSM::AXM_FIRST_FORWARD_COMPATIBILITY_VERSION = 0
 AXM forward compatibility file version If you make a change to the AXM file structure that makes it impossible for older applications to read this new file, you need to increase AXM_FORWARD_COMPATIBILITY_VERSION. More...
 
const size_t WSM::AXM_FORWARD_COMPATIBILITY_VERSION = 0
 Latest compatibility version This needs to be the same as the last version above. More...
 

Model Change Callbacks

The "model changed" callback that will be called on the completion of each Delta or Undo/Redo operation within any non-temporary History.

Passed to APIRegisterModelChangedCallbackReadOnly.

using WSM::CallbackType = void(ModelChangeData const &)
 
using WSM::FunctionType = 1::function< CallbackType >
 

Typedef Documentation

using WSM::CallbackType = typedef void(ModelChangeData const &)
using WSM::FunctionType = typedef 1::function<CallbackType>
using WSM::IsObjectHiddenFunctionType = typedef 1::function<bool(const WSM::GroupInstancePath&, double)>

! Callback function type used by APISlice ! It receives a WSM::GroupInstancePath object and a depth parameter.

If the depth parameter ! is WSM_DISTANCE_BIG, the function is intended to test whether the object is hidden by layer ! visibility or other general visibility settings (such as Hide Group Context). If the ! depth parameter is less than WSM_DISTANCE_BIG, the callback is intended to check whether ! the object is hidden at the given depth. This is the case, for example, when section planes are ! defined and an object may be entirely or partially clipped

Enumeration Type Documentation

enum WSM::DeltaFlag : size_t
strong
Enumerator
nNotMine 

Collaboration: distinguish between Delta from others and mine.

nAddedToOutQueue 

Collaboration: this Delta has been added to the outgoing queue.

nSentToServer 

Collaboration: this Delta has already been sent to the server.

nServerAccepted 

Collaboration: whether server has already accepted this Delta.

Enumerated type with bitfield values that define the Loop or Edge convexity.

Enumerator
nConvexityUnset 
nConvexitySmooth 

Smooth is defined as WSM_TIGHT_SMOOTH_COSINE_ANGLE.

nConvexityConcave 

Indicates that convexity of all edges in the loop are Smooth.

Indicates that convexity of all the edges in the loop are Concave.

nConvexityConvex 

Indicates that convexity of all the edges in the loop are Convex.

nConvexityMixed 

Indicates that edges in the loop have mixed convexity.

nConvexityNonManifold 
enum WSM::nCopyBehavior : size_t
strong

Enumerated type describing an Object's copy behavior.

Enumerator
nDoNotCopyNorShare 

The copied owner will not share nor have a copy of this Object.

nShareOrCopy 

Shares the Object with the copied owner except when copying to a new.

nCopyAlways 

History in which case the Object is copied.

Always copies the Object even when in this same History

nNumCopyBehaviors 

This should always be last.

enum WSM::nFileType : int

Supported file types. Passed to save/load APIs to specify the file type.

Enumerator
nFileTypeBinaryWSM 

Do NOT change numeric values as they are used in JS! (see RegisterWSMScript.cpp)

nFileTypeSAT 
nFileTypeSTL 
nFileTypeOBJ 
nFileTypeDWG 
nFileTypeLMV 
nFileTypeThreejsJSON 
nFileTypeFBX 
nFileTypeSKP 
nFileTypeDAE 
nFileTypeDXF 
nFileTypeJSON 
nFileTypeATFX 
enum WSM::nHistoryComparison : size_t

Results of History check produced by APICheckHistoryReadOnly(), which checks the local History of this client and remote History of the collaboration server, the latter contains only "accepted" Deltas.

Enumerator
nIdentical 

two histories have same Delta IDs and same active Delta

nLessAcceptedDeltas 

local H has fewer accepted Deltas than the server H

nMoreAcceptedDeltas 

local H has more accepted Deltas than the server H, which happens if it hasn't received some Undo+Delta yet

nMoreLocalDeltas 

local H has more (not-yet accepted) Deltas than the server H

nLocalActiveDeltaLower 
nLocalActiveDeltaHigher 

can't be set simultaneously with nLocalActiveDeltaLower

nOutOfSync 

some irreconcilable differences (like accepted Delta IDs differ)

enum WSM::nLoadingOptions : size_t
strong

Available options for the nOptions argument of APILoadFromFile()

Enumerator
NoOptions 

No loading options.

Merge 

Merge all merge-able vertices and edges for OBJ and STL files.

PlaceOnGround 

Place OBJ file model on ground plane.

RemoveDuplicate 

Remove duplicated vertices and edges from OBJ model.

SmoothingByAngle 

Do smoothing by angle processing for model if smoothing ids are not specified directly.

CreateMesh 

Create a Mesh for OBJ and STL files.

Supported object types.

Note, the order of these enums can NEVER be changed. If the order is changed, old WSM files will not restore properly. When adding new types, always add them to the end before nNumObjectTypes.

Enumerator
nUnSpecifiedType 

also used for DELETED objects in Delta serialization

nBodyType 
nLumpType 
nShellType 
nFaceType 
nLoopType 
nCoedgeType 
nEdgeType 
nVertexType 
nMaterialAttributeType 
nMaterialType 
nCircleAttributeType 
nObjectPropertiesAttributeType 
nTextureType 
nLevelAttributeType 
nLevelType 
nSketchPropertiesType 
nSplineCurveAttributeType 
nCylinderSurfaceAttributeType 
nSphereSurfaceAttributeType 
nExtrudeSurfaceAttributeType 
nImageType 
nSatelliteDataAttributeType 
nGroupType 
nInstanceType 
nLayerAttributeType 
nLayerType 
nGeneratedGeometryInformationType 
nFaceUVDataAttributeType 
nEdgeStyleAttributeType 
nBlendAttributeType 
nStringAttributeType 
nMeshType 
nLineMeshType 
nPointMeshType 
nNumObjectTypes 

This should always be last.

Function Documentation

WSM_EXPORT Result WSM::APIAddFaceComponentToBody ( size_t  nHistoryID,
size_t  nFaceID,
size_t  nBodyID 
)

Adds a Face and all connected Faces to a Body.

Parameters
[in]nHistoryIDID of the given History
[in]nFaceIDID of the given Face
[in]nBodyIDID of the given Body
WSM_EXPORT Result WSM::APIAddInstancesToGroup ( size_t  nHistoryID,
size_t  nGroupID,
1::vector< Transf3d > const &  aTransforms,
1::vector< size_t > &  aNewInstanceIDs 
)

Creates new instances in the specified group and returns their IDs.

Parameters
[in]nHistoryIDID of the given History
[in]nGroupID
[in]aTransforms
[out]aNewInstanceIDs
WSM_EXPORT Result WSM::APIAddObjectsLayers ( size_t  nHistoryID,
1::vector< size_t > const &  aLayerIDs,
1::vector< size_t > const &  aObjectIDs 
)

Add layers to objects.

Parameters
[in]nHistoryIDID of the given History
[in]aLayerIDs
[in]aObjectIDs
WSM_EXPORT Result WSM::APIAddRemoveObjectsLayers ( size_t  nHistoryID,
1::vector< size_t > const &  aLayerAddIDs,
1::vector< size_t > const &  aLayerRemoveIDs,
1::vector< size_t > const &  aObjectIDs 
)

Add layers to and remove layers from objects in a single operation.

The Add operations happen first, so if the same layer is in both vectors, the layer will be removed from the object.

Parameters
[in]nHistoryIDID of the given History
[in]aLayerAddIDs
[in]aLayerRemoveIDs
[in]aObjectIDs
WSM_EXPORT Result WSM::APIAddSolidDefGuids ( size_t  nHistoryID,
const 1::vector< size_t > &  aObjectIDs 
)

Adds solid-def guids in StringAttributes to the given Objects.

Parameters
[in]nHistoryIDID of the given History
[in]aObjectIdsIDs of objects that get guids
[in]aObjectIDsThe given list of Object IDs
WSM_EXPORT Result WSM::APIBlend ( size_t  nHistoryID,
double  dRadius,
const 1::vector< size_t > &  aPathIDs,
const double  accuracyORcount = 6.0,
size_t  nMinimumNumberOfFacets = 0 
)

Creates a blend surface using the Edges given by aPathIDs.

aPathIDs can contain a single Face ID, in which cases every Edge on the Face will be blended, or a vector of Edge IDs, where each Edge is blended. Note in order for the blend to be successful, each Edge must be manifold belonging to exactly 2 Faces and all the Faces must be in the same Body. Use accuracyORcount and nMinimumNumberOfFacets to control the number of facets on the blend.

Parameters
[in]nHistoryIDID of the given History
[in]dRadius
[in]aPathIDs
[in]accuracyORcount
  • MAX distance between base circle and segment as portion of R, if < .75
  • number of divisions (double rounded to int) over 90 degree arc, if >= .75
[in]nMinimumNumberOfFacetsIf non-zero, the arc will contain at least that many facets. This value can override what is specified by accuracyORcount.
WSM_EXPORT Result WSM::APICanRedoHistoryReadOnly ( size_t  nHistoryID,
bool &  bCanRedo 
)

Sets bCanRedo to true if it is possible to redo one Delta.

Parameters
[in]nHistoryIDID of the given History
[out]bCanRedotrue if redo is possible
WSM_EXPORT Result WSM::APICanRedoHistoryToDeltaReadOnly ( size_t  nHistoryID,
size_t  nDeltaID,
bool &  bCanRedo 
)

Sets bCanRedo to true if it is possible to redo to nDeltaID.

Parameters
[in]nHistoryIDID of the given History
[in]nDeltaIDID of the given Delta
[out]bCanRedotrue if redo is possible
WSM_EXPORT Result WSM::APICanUndoHistoryReadOnly ( size_t  nHistoryID,
bool &  bCanUndo 
)

Sets bCanUndo to true if it is possible to undo one Delta.

Parameters
[in]nHistoryIDID of the given History
[out]bCanUndotrue if undo is possible
WSM_EXPORT Result WSM::APICanUndoHistoryToDeltaReadOnly ( size_t  nHistoryID,
size_t  nDeltaID,
bool &  bCanUndo 
)

Sets bCanUndo to true if it is possible to undo to nDeltaID.

Accepts the WSM::INVALID_ID flag to indicate the beginning of history.

Parameters
[in]nHistoryIDID of the given History
[in]nDeltaIDID of the given Delta
[out]bCanUndotrue if undo is possible
WSM_EXPORT Result WSM::APIChangeHistoryID ( size_t &  nHistoryIDtoChange)

Change ID of a History, nHistoryIDtoChange, and reset it everywhere the old ID was referenced: in Objects belonging to the History being modified as well as in Groups referencing it.

Note: Although this API doesn't have "ReadOnly" in its name (since it modifies the model), it does NOT produce a Delta, as the changes it makes are not discernible from the outside of WSM.

Parameters
[out]nHistoryIDtoChange
WSM_EXPORT Result WSM::APICheckHistoryValidityReadOnly ( const size_t  nHistoryID,
1::vector< Result > &  aErrors 
)

Finds all errors in the History (including on every live Object in the History).

Note this is a read-only operation.

Parameters
[in]nHistoryIDID of the given History
[out]aErrors
WSM_EXPORT Result WSM::APICheckMassesCollideReadOnly ( size_t  nHistoryID,
bool &  bCollisionDetected 
)

Returns true if bodies that enclose volume (possibly in instances) touch or overlap.

Parameters
[in]nHistoryIDID of the given History
[out]bCollisionDetectedTrue if overlapping bodies exist.
WSM_EXPORT Result WSM::APICheckValidityReadOnly ( const size_t  nHistoryID,
const size_t  nObjectID,
1::vector< Result > &  aErrors 
)

Finds all errors on the Object.

Note this is a read-only operation.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectIDID of the given Object
[out]aErrors
WSM_EXPORT Result WSM::APICleanModel ( size_t  nHistoryID,
double  dEdgeTol = 0.0,
1::vector< size_t > *  paChangedHistories = nullptr 
)

Changes the model fixing errors and getting rid of undesired features.

In particular:

  1. Deletes Groups with no Instances.
  2. Deletes Faces with no area.
  3. Deletes interior Loops with no area,
  4. Deletes Coedges that have no Edge.
  5. If dEdgeTol is not zero, removes Edges shorter than dEdgeTol stitching the model closed when possible.
  6. If more than one GeneratedGeometryInformation exists, deletes all but the first.
  7. Deletes non-owned Coedges, non-owned Textures, and unused Materials. Referenced Histories from Groups are always included in the correction so Deltas in multiple Histories may result from this API. If paChangedHistories is given, all Histories that have been changed will be returned.
    Parameters
    [in]nHistoryIDID of the given History
    [in]dEdgeTol
    [out]paChangedHistories
WSM_EXPORT Result WSM::APICompareHistoryReadOnly ( size_t  nHistoryID,
size_t  nActiveDeltaIdx,
const 1::vector< size_t > &  aDeltaIDs,
nHistoryComparison nComparisonResult 
)

Compare nHistoryID with parameters of collaboration server's History, which contains only "accepted" Deltas.

The result of this comparison is returned in nComparisonResult parameter. Note this is for internal use only and is not exposed to javascript.

Parameters
[in]nHistoryIDID of the given History
[in]nActiveDeltaIdx
[in]aDeltaIDsThe given list of Delta IDs
[out]nComparisonResult
WSM_EXPORT Result WSM::APIComputeAreaReadOnly ( size_t  nHistoryID,
size_t  nObject,
double &  dArea,
const WSM::Transf3d pTransf3d = nullptr 
)

Computes the surface area of the Object.

Note, if pTransf3d is non-NULL it is used to transform the Object before computing the area. This should only have an effect on the computation if the transform is non-rigid.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectID of the given Object
[out]dArea
[in]pTransf3d
WSM_EXPORT Result WSM::APIComputeSharedMeshDataReadOnly ( size_t  nHistoryID,
size_t  nMeshID,
1::vector< float > &  aPoints,
1::vector< uint32_t > &  aTriangles,
1::vector< float > &  aNormals,
1::vector< uint32_t > *  paUVTriangles = nullptr,
1::vector< float > *  paUVs = nullptr,
1::vector< uint32_t > *  paEdges = nullptr,
double  dCosSmoothAngle = 0.86602540378443864676372317075294 
)

Returns the point, normal, and triangle data from a Mesh shared so that indices with equal points and normals are reused.

aPoints.size() and aNormals.size() are both divisible by 3. Each 3-tuple of floats in aPoints is a point in the Mesh. And each 3-tuple of floats in aNormals is a normal in the Mesh which corresponds to aPoints. Note normals are optional hence aNormals may be empty. aTriangles.size() is divisible by 3. Each 3-tuple of uint32_ts in aTriangles defines a triangle in the Mesh where each uint32_t is an index to a point in aPoints and a normal in aNormals, when aNormals is not empty. So the max uint32_t value in aTriangles can be at most aPoints.size() / 3 - 1. If both paUVTriangles and paUVs are given, also computes shared UV data. Note the size of paUVTraingles will equal the size of aTriangles when there are UVs, but paUVs could be larger than aPoints since for example UVs are not shared along a seam. If paEdges if non-NULL, pairs of indices into aPoints that correspond to non-smooth edges as specified by dCosSmoothAngle are also returned. The number of triangles from APIGetMeshDataReadOnly matches the number of triangles returned here since sharing geometry does not change the number of triangles. This API is intended to be used for systems that require matching points and normals for some operations such as computing silhouettes in Revit.

Parameters
[in]nHistoryIDID of the given History
[in]nMeshIDID of the given Mesh
[out]aPointsPoints
[out]aTrianglesTriangles
[out]aNormalsNormals at each point
[out]paUVTrianglesIndices of UVs for the mesh triangles
[out]paUVsUVs
[out]paEdgesEdges where subsequent pairs of shared indices form the edge
[in]dCosSmoothAngleCosine of the angle where edges are considered smooth
WSM_EXPORT Result WSM::APIComputeVolumeReadOnly ( size_t  nHistoryID,
size_t  nObject,
double &  dVolume,
const WSM::Transf3d pTransf3d = nullptr 
)

Computes the volume of the Object.

Note, if pTransf3d is non-NULL it is used to transform the Object before computing the volume. This should only have an effect on the computation if the transform is non-rigid.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectID of the given Object
[out]dVolume
[in]pTransf3d
WSM_EXPORT Result WSM::APIConnectPoint3ds ( size_t  nHistoryID,
const WSM::Point3d pt1,
const WSM::Point3d pt2 
)

Connect two Point3ds for use in 3D sketching creating Edges as appropriate, splitting Faces and Edges, creating new Faces as planar areas are enclosed, etc.

Parameters
[in]nHistoryIDID of the given History
[in]pt1The first given point
[in]pt2The second given point
WSM_EXPORT Result WSM::APIConnectVertexAndPoint3d ( size_t  nHistoryID,
size_t  nVertexID,
const WSM::Point3d pt 
)

Connect a Vertex and a Point3d for use in 3D sketching creating Edges as appropriate, splitting Faces and Edges, creating new Faces as planar areas are enclosed, etc.

Parameters
[in]nHistoryIDID of the given History
[in]nVertexID
[in]pt
WSM_EXPORT Result WSM::APIConnectVertices ( size_t  nHistoryID,
size_t  nVertexID1,
size_t  nVertexID2 
)

Connect two Vertices for use in 3D sketching creating Edges as appropriate, splitting Faces and Edges, creating new Faces as planar areas are enclosed, etc.

Parameters
[in]nHistoryIDID of the given History
[in]nVertexID1ID of the first Vertex
[in]nVertexID2ID of the second Vertex
WSM_EXPORT Result WSM::APIConvertMeshesToObjects ( size_t  nHistoryID,
const 1::vector< size_t > &  aMeshIDs,
1::vector< size_t > &  aCreatedObjectIDs,
double  dCosSmoothAngle = -1.0,
bool  bFlatten = false 
)

Converts Meshes into Bodies with triangular Faces.

Converts LineMeshes and PointMeshes into Groups containing non-owned Edges and Vertices respectively. The original Meshes, LineMeshes, and PointMeshes are deleted. Note when the a single LineMesh or PointMesh is converted in an otherwise empty History, will make Edges or Points directly, not inside a Group. This is to avoid double grouping. Returns a vector of created Objects. If dCosSmoothAngle is greater than 0, smooth Edges will be merged and Edges on nearly coplanar Faces that cannot be merged will be marked smooth. dCosSmoothAngle is the cosine of the angle at which an Edge should be considered smooth. For example is dCosSmoothAngle is 1, smooth Edges will be merged out. If dCosSmoothAngle is 0.86602540378443864676372317075294, smooth Edges will be merged out and Edges on 2 Faces whose normals make an angle of less than 30 degrees will be marked smooth. Note Bodies from Meshes that originally came from a single Object are united to reduce the chance of non-watertight geometry. If it is important for each Body to correspond exactly with the original Mesh, convert the Meshes one at a time. If bFlatten is true, then nearly smooth faces, within the tolerance of the mesh, will be flattened into a single face.

Parameters
[in]nHistoryIDID of the given History
[in]aMeshIDsIDs of the Meshes to be converted
[out]aCreatedObjectIDsIDs of the created Objects.
[in]dCosSmoothAngleCosine of the angle where edges are considered smooth
[in]bFlattenTrue means nearly smooth faces are flattened to a single face.
WSM_EXPORT Result WSM::APIConvertObjectsToMeshes ( size_t  nHistoryID,
const 1::vector< size_t > &  aObjectIDs,
1::vector< size_t > &  aCreatedMeshIDs 
)

Converts non-Mesh Objects into Meshes with one Mesh per Material used.

The original Objects are deleted. Returns a vector of created Meshes.

Parameters
[in]nHistoryIDID of the given History
[in]aObjectIDsIDs of the Objects to be converted
[out]aCreatedMeshIDsIDs of the created Meshes
WSM_EXPORT Result WSM::APICopyObject ( const size_t  nFromHistoryID,
size_t  nToHistoryID,
const size_t  nFromObjectID,
size_t &  nCreatedObjectID 
)

Create a copy of the Object in the given History.

Parameters
[in]nFromHistoryIDID of the source history
[in]nToHistoryIDID of the destination history
[in]nFromObjectIDID of the source object
[out]nCreatedObjectIDID of the created object
WSM_EXPORT Result WSM::APICopyOrSketchAndTransformObjects ( const size_t  nFromHistoryID,
const size_t  nToHistoryID,
const 1::vector< size_t > &  aFromObjectIDs,
1::vector< size_t > &  aCopiedObjectIDs,
const WSM::Transf3d transform = WSM::Transf3d::kIdentity,
const size_t  nNumCopies = 1,
bool  bGroupBodies = false,
const WSM::Transf3d pGroupTransf3d = nullptr 
)

Copies the given objects as an array of incremental transforms.

Simply copies bodies, or 3d sketches top-level faces or edges in the correct location

Parameters
[in]nFromHistoryIDID of the source history
[in]nToHistoryIDID of the destination history
[in]aFromObjectIDsID list of the source objects in the source history
[out]aCopiedObjectIDsThe returned ID list of copied objects in the destination history. Edge arraying is done by sketching, so these results are not returned, because it is hard to know what is created during 3d sketching.
[in]transformThe incremental transformation to be applied. Each copy, n=1, 2, ... , numCopies, is applied transform^n
[in]nNumCopiesThe number of copies to make
[in]bGroupBodiesIf true, Bodies are made into Groups before the copy.
[in]pGroupTransf3dIf provided, the inverse of the transform is applied to Bodies inside the Group, then the transform is applied to the Instance. This results in the Instance's bounding box being aligned with the transform. Note this has no affect when bGroupBodies is false.
WSM_EXPORT Result WSM::APICover ( size_t  nHistoryID,
const 1::vector< size_t > &  aEdgeIDs,
bool  bMerge = false 
)

Makes Faces that cover a closed circuit of Edges.

If aEdgeIDs contains a single Edge, the API will try to find a closed circuit of Edges from the Edge. This succeeds when there is only one closed circuit of Edges that can be made from the given Edge or when there is only one closed circuit of Edges where each Edge is on one Face only. If bMerge is true, existing Edges that are mergeable on the boundary of the cover Faces will also be merged.

Parameters
[in]nHistoryIDID of the given History
[in]aEdgeIDs
[in]bMergeIf true, existing Edges that are mergeable on the boundary of the cover Faces will also be merged.
WSM_EXPORT Result WSM::APICreateBlock ( const size_t  nHistoryID,
const WSM::Point3d pos1,
const WSM::Point3d pos2,
size_t &  nCreatedObjectID 
)

Create a block with the given corners.

Parameters
[in]nHistoryIDID of the given History
[in]pos1The given lower bound of the block
[in]pos2The given upper bound of the block
[out]nCreatedObjectIDID of the created object
WSM_EXPORT Result WSM::APICreateCircleOrArc ( const size_t  nHistoryID,
const double  radius,
const WSM::Point3d posCenter,
1::vector< WSM::Point3d > &  aPoints,
const WSM::UnitVector3d xAxis = WSM::UnitVector3d::kXDir,
const WSM::UnitVector3d yAxis = WSM::UnitVector3d::kYDir,
double  dStartParam = 0.0,
double  dEndParam = WSM_2PI,
const double  accuracyORcount = 10.0,
bool  bReadOnly = false,
const WSM::Transf3d trans = WSM::Transf3d::kIdentity,
size_t  nMinimumNumberOfFacets = 0 
)

Create a vector of Point3ds of a circle or arc defined by C(t) = posCenter + radius * (xAxis * cos(t) + yAxis * sin(t)), where t goes from dStartParam to dEndParam.

Parameters
[in]nHistoryIDID of the given History
[in]radiusThe given radius
[in]posCenterThe given center position
[out]aPointsThe created vector of points
[in]xAxisThe given x-axis unit vector
[in]yAxisThe given y-axis unit vector
[in]dStartParamThe given angle defining the start point of the arc
[in]dEndParamThe given angle defining the end point of the arc
[in]accuracyORcount
  • MAX distance between base circle and segment as portion of R, if < .75
  • number of divisions (double rounded to int) over 90 degree arc, if >= .75
[in]bReadOnlyIf true, no Objects are created, and only the points are returned
[in]transIf non-identity, the points will be transformed by trans.
[in]nMinimumNumberOfFacetsIf non-zero, the arc will contain at least that many facets. This value can override what is specified by accuracyORcount.
WSM_EXPORT Result WSM::APICreateCircleOrArcFromPoints ( const size_t  nHistoryID,
const WSM::Point3d arcStartPos,
const WSM::Point3d arcEndPos,
const WSM::Point3d thirdPoint,
1::vector< WSM::Point3d > &  aPoints,
const double  accuracyORcount = 10.0,
bool  bReadOnly = false,
const WSM::Transf3d trans = WSM::Transf3d::kIdentity,
size_t  nMinimumNumberOfFacets = 0,
bool  bCircle = false 
)

Create a vector of Point3ds of a circular arc, defined with a arcStartPos, arcEndPos, and a thirdPoint.

Note the 3 given points must always be distinct even when making a full circle.

Parameters
[in]nHistoryIDID of the given History
[in]arcStartPosThe given start point of the arc
[in]arcEndPosThe given end point of the arc
[in]thirdPointThe given thirdPoint is projected onto the plane defined by the midpoint between arcStartPos and arcEndPos, with normal along the vector between start and end.
[out]aPointsThe created vector of points
[in]accuracyORcount
  • MAX distance between base circle and segment as portion of R, if < .75
  • number of divisions (double rounded to int) over 90 degree arc, if >= .75
[in]bReadOnlyIf true, no Objects are created, and only the points are returned
[in]transIf non-identity, the created points will be transformed by trans.
[in]nMinimumNumberOfFacetsIf non-zero, the arc will contain at least that many facets. This value can override what is specified by accuracyORcount.
[in]bCircleIf bCircle is true, make a full circle through the 3 given points.
WSM_EXPORT Result WSM::APICreateClampedHermiteSplineDataReadOnly ( const size_t  nHistoryID,
const 1::vector< WSM::Point3d > &  aControlPoints,
const WSM::Vector3d startTangent,
const WSM::Vector3d endTangent,
bool  bClosed,
const 1::vector< size_t > &  aVertexIDsOnSpline,
size_t  nNumberOfNewContolPoints,
1::vector< WSM::Point3d > &  aNewControlPoints,
WSM::Vector3d startTangentNew,
WSM::Vector3d endTangentNew,
bool &  bClosedNew,
1::map< double, size_t > &  mVertextParameterMap 
)

Create a clamped cubic spline from the data of a spline and the original vertex points on the spline.

Fills the aNewControlPoints, startTangentNew, endTangentNew and bClosedNew arguments. Also returns a map of the parameter values of each vertex. This is used to find the closest point on the new spline curve.

Parameters
[in]nHistoryIDID of the given History
[in]aControlPointsThe given vector of spline control points
[in]startTangentThe given tangent vector at the spline start point
[in]endTangentThe given tangent vector at the spline end point
[in]bClosedSpecifies whether the spline end point is the start point, i.e. whether the curve must be smooth and closed.
[in]aVertexIDsOnSplineThe ID list of original vertex points on the spline.
[in]nNumberOfNewContolPointsThe requested number of new spline control points
[out]aNewControlPointsThe returned vector of new control points of the new spline
[out]startTangentNewThe returned tangent vector at the start point of the new spline
[out]endTangentNewThe returned tangent vector at the end point of the new spline
[out]bClosedNewReturns true, if the end point is the start point of the new spline
[out]mVertextParameterMapThe returned map of the parameter values of each vertex, used to find the closest point on the new spline curve.
WSM_EXPORT Result WSM::APICreateCone ( const size_t  nHistoryID,
const double  radius,
const double  height,
const WSM::Point3d posCenter,
size_t &  nCreatedObjectID,
const double  accuracyORcount = 10.0 
)

Create a cone (above Z=0) with given parameters.

Parameters
[out]nCreatedObjectIDID of the created object
[in]nHistoryIDID of the given History
[in]radiusThe given radius
[in]heightThe given height
[in]posCenterThe given center position
[in]accuracyORcount
  • MAX distance between base circle and planar face as portion of R, if < .75
  • number of divisions (double rounded to int) over 90 degree arc, if >= .75
WSM_EXPORT Result WSM::APICreateCylinder ( size_t  nHistoryID,
const WSM::Point3d aPosCenter,
double  aRadius,
double  aHeight,
size_t &  nCreatedObjectID,
double  aAccuracyORcount = 10,
const WSM::UnitVector3d aAxis = WSM::UnitVector3d::kZDir 
)

Create a cylinder on the given History.

Parameters
[in]nHistoryIDID of the given History
[in]aPosCenterThe given center position
[in]aRadiusThe given radius; must be positive.
[in]aHeightThe given distance between cylinder's top and bottom face; must be positive.
[out]nCreatedObjectIDID of the created object
[in]aAccuracyORcount
  • MAX distance between base circle and planar face as portion of R, if < .75
  • number of divisions (double rounded to int) over 90 degree arc, if >= .75
[in]aAxis
WSM_EXPORT Result WSM::APICreateEdgesFromData ( size_t  nHistoryID,
size_t &  nCreatedGroupID,
1::vector< LayerData > const &  aLayers,
1::vector< EdgeData > const &  aEdges,
1::vector< CurveData > const &  aCurves,
bool  bCreateMesh = true,
const double  accuracyORcount = 10.0 
)

Load a set of edges from vectors of various data in a single delta.

All edges are added in a new group returned in nCreatedGroupID The structures are defined in the header GeometryDataContainers.h If bCreateMesh is true, LineMeshes are created instead of Edges.

Parameters
[in]nHistoryIDID of the given History
[out]nCreatedGroupIDID of the created Group
[in]aLayers
[in]aEdges
[in]aCurves
[in]aCreateMeshIf true, create meshes rather than Edges.
[in]accuracyORcount
  • MAX distance between sphere and planar face as portion of R, if < .75
  • number of divisions (rounded double) over 90 degree arc, if >= .75
[in]bCreateMesh
WSM_EXPORT Result WSM::APICreateEmptyBody ( size_t  nHistoryID,
size_t &  nCreatedObjectID 
)

Creates an empty Body.

Parameters
[in]nHistoryIDID of the given History
[out]nCreatedObjectIDID of the created object
WSM_EXPORT Result WSM::APICreateExtrusion ( size_t  nHistoryID,
const 1::vector< WSM::Point3d > &  aPoints,
double  dist,
size_t &  nCreatedObjectID 
)

Create an extrusion on the given History.

aPoints must have more than 3 points and be on the same plane. Extrusion direction is along the normal direction determined by the anticlockwise polygon.

Parameters
[in]nHistoryIDID of the given History
[in]aPointsThe input list of points
[in]distThe given distance for dragging the extrusion
[out]nCreatedObjectIDID of the created object
WSM_EXPORT Result WSM::APICreateGeometryFromData ( size_t  nHistoryID,
1::vector< TextureData > const &  aTextures,
1::vector< MaterialData > const &  aMaterials,
1::vector< LayerData > const &  aLayers,
1::vector< InstanceData > const &  aInstances,
1::vector< 1::vector< FaceData >> const &  aFaceCollections,
1::vector< EdgeData > const &  aEdges,
1::vector< CurveData > const &  aCurves,
1::vector< ImageData > const &  aImages,
const 1::string &  aGroupName = {},
bool  bCreateMesh = false 
)

APICreateGeometryFromData function.

Parameters
[in]nHistoryIDID of the given History
[in]aTextures
[in]aMaterials
[in]aLayers
[in]aInstances
[in]aFaceCollections
[in]aEdges
[in]aCurves
[in]aImages
[in]aGroupName
[in]aCreateMeshIf true, create meshes rather than bodies.
[in]bCreateMesh
WSM_EXPORT Result WSM::APICreateGroup ( size_t  nHistoryID,
const 1::vector< size_t > &  aObjectIDs,
size_t &  nCreatedGroupID,
const 1::vector< WSM::Transf3d > *  pInstanceTransforms = nullptr,
size_t  nReferencedHistory = WSM::INVALID_ID,
WSM::Transf3d const *  pGeometryTransform = nullptr 
)

Creates a Group with the given aObjectIDs, which are removed from nHistoryID.

Optionally provide a vector of transformations for each instance. If no vector of transformations is given, one instance of the Objects with a identity transformation is created. Uses the referenced History if provided. If pGeometryTransform is provided, this transform is applied to the objects after they are copied into the group.

Note, Groups are only created using non-owned Objects, Faces, and Instances. If any objects provided are not moved or copied to the new referenced history, either directly or indirectly because of a parent object, then the warning nSomeInputIgnored is set, and those IDs are stored in the Result. These can be retrieved using the Result's member function GetHistoryObjectIDs.

Parameters
[in]nHistoryIDID of the given History
[in]aObjectIDsThe given list of Object IDs
[out]nCreatedGroupIDID of the created Group
[in]pInstanceTransforms
[in]nReferencedHistory
[in]pGeometryTransform
WSM_EXPORT Result WSM::APICreateHemisphere ( const size_t  nHistoryID,
const double  radius,
const WSM::Point3d posCenter,
size_t &  nCreatedObjectID,
const double  accuracyORcount = 10.0 
)

Create a half sphere (above Z=0) with given parameters.

Parameters
[out]nCreatedObjectIDID of the created object
[in]nHistoryIDID of the given History
[in]radiusThe given radius
[in]posCenterThe given center position
[in]accuracyORcount
  • MAX distance between sphere and planar face as portion of R, if < .75
  • number of divisions (rounded double) over 90 degree arc, if >= .75
WSM_EXPORT Result WSM::APICreateHermiteSpline ( const size_t  nHistoryID,
const 1::vector< WSM::Point3d > &  aControlPoints,
1::vector< WSM::Point3d > &  aOutPoints,
bool  bClosed = false,
const WSM::Vector3d startTangent = WSM::Vector3d::kNull,
const WSM::Vector3d endTangent = WSM::Vector3d::kNull,
bool  bReadOnly = false,
1::vector< double > *  aOutPointsParams = nullptr 
)

Tessellate a cubic spline that touches all aControlPoints.

Fills the tessellated points into aOutPoints. startTangent and endTangent are optional.

Parameters
[in]nHistoryIDID of the given History
[in]aControlPointsThe given vector of spline control points
[out]aOutPointsThe returned vector of tessellated points
[in]bClosedSpecifies whether the spline end point is the start point, i.e. whether the curve must be smooth and closed.
[in]startTangentThe given tangent vector at the spline start point
[in]endTangentThe given tangent vector at the spline end point
[in]bReadOnlyIf true, no geometry is created, and only the tessellated points are returned.
[out]aOutPointsParamsOptional. If specified, returns the spline parameter value for each of the returned aOutPoints.
WSM_EXPORT Result WSM::APICreateHistory ( size_t &  nHistoryID,
bool  bNonTemporary = true 
)

Create a History and return the History ID.

Parameters
[in,out]nHistoryIDID of the created History. If WSM::INVALID_ID, a new ID is generated, otherwise the given ID will be used. If the given nHistoryID is the ID of an existing History and the existing History is temporary or both the existing History and the requested History are non-temporary, then the existing History will be cleared. If the requested History is temporary and the existing History is non-temporary, a new History is created and the requested ID is ignored. It is important to check the returned nHistoryID to verify the ID of the History returned.
[in]bNonTemporaryOptional. Specifies whether this history is a temporary one (and no messages are sent to the callback for it except for deletion of the history).
WSM_EXPORT Result WSM::APICreateImageObject ( const size_t  nHistoryID,
const 1::string &  sName,
const size_t  nTextureID,
const float  fAlphaValue,
const bool  bFeaturesVisible,
const 1::array< WSM::Point3d, 4 > &  aCorners,
size_t &  nObjectID 
)

Creates an image object.

It's associated with a texture, having an alpha value to change its opacity [1.0, 0.0] (totally opaque to totally transparent) bFeaturesVisible is used to show (or not) computer vision recognized data (edges, vertex, etc.) The underlying geometry is represented by 4 corners. It can have a user defined name.

Parameters
[in]nHistoryIDID of the given History
[in]sName
[in]nTextureID
[in]fAlphaValue
[in]bFeaturesVisible
[in]aCorners
[out]nObjectIDID of the created Object
WSM_EXPORT Result WSM::APICreateImageObjectWithTexture ( const size_t  nHistoryID,
const 1::string &  sName,
const float  fAlphaValue,
const bool  bFeaturesVisible,
const 1::array< WSM::Point3d, 4 > &  aCorners,
1::vector< char > const &  aBitmapData,
size_t &  nObjectID,
1::string const &  sTextureName = {} 
)

Creates an image object with texture.The image is connected to an internal texture object.

having an alpha value to change its opacity [1.0, 0.0] (totally opaque to totally transparent) bFeaturesVisible is used to show (or not) computer vision recognized data (edges, vertex, etc.) The underlying geometry is represented by 4 corners. It can have a user defined name. aBitmapData must represent a JPEG or PNG formatted image returns the created image ID by nObjectID. The texture name is intended as a user-provided name.

Parameters
[in]nHistoryIDID of the given History
[in]sName
[in]fAlphaValue
[in]bFeaturesVisible
[in]aCorners
[in]aBitmapDataMust represent a JPEG or PNG formatted image
[out]nObjectIDID of the created Object
[in]sTextureNameIntended as a user-provided name
WSM_EXPORT Result WSM::APICreateLayer ( size_t  nHistoryID,
1::string const &  name,
bool  bDisplayed,
size_t &  nLayerID 
)

Create a layer object with a given name and display flag.

Parameters
[in]nHistoryIDID of the given History
[in]nameName for the Object
[in]bDisplayed
[out]nLayerID
WSM_EXPORT Result WSM::APICreateLevelObjects ( const size_t  nHistoryID,
const 1::vector< 1::pair< 1::string, double > > &  aLevelsData,
1::vector< size_t > &  aLevelIDs 
)

Creates Level objects with the data provided by aLevelsData.

This allows to add multiples levels using one delta only. The Level stores the level's name and elevation and is connected internally to other WSM Objects by LevelAttributes. Returns a vector containing the IDs of the Level objects.

Parameters
[in]nHistoryIDID of the given History
[in]aLevelsData
[out]aLevelIDs
WSM_EXPORT Result WSM::APICreateLineMesh ( size_t  nHistoryID,
size_t &  nLineMeshID,
const 1::vector< float > &  aPoints,
const 1::vector< uint32_t > &  aIndices,
const 1::vector< uint32_t > &  aCounts 
)

Creates a LineMesh in the History given by nHistoryID.

nLineMeshID is the ID of the created LineMesh. aPoints must be a non-empty vector of floats where aPoints.size() is divisible by 3. Each 3-tuple of floats in aPoints will be a point in the created LineMesh. aIndices is a vector of indices, where the ith index corresponds to the point (aPoints[3 * aIndices[i]], aPoints[3 * aIndices[i] + 1], aPoints[3 * aIndices[i] + 2]). aCounts is a monotonically increasing vector that describes connected line segments where the number of points that make up the connected segments in the ith polyline is given by aCounts[i] - aCounts[i - 1] and the points in the ith segment are given by aIndices[aCounts[i - 1]], aIndices[aCounts[i - 1] + 1], ..., aIndices[aCounts[i] - 1]. For example if the aCounts vector is [5, 8, 12] then the first line is formed by connecting the point given by aIndices[0] to the point given by aIndices[1] to aIndices[2] to aIndices[3] to aIndices[4]. The second line connects aIndices[5] to aIndices[6] to aIndices[7]. The third line is from aIndices[8] to aIndices[9] to aIndices[10] to aIndices[11].

Parameters
[in]nHistoryIDID of the given History
[out]nLineMeshIDID of the created LineMesh
[in]aPointsPoints
[in]aIndicesIndices
[in]aCountsCounts
WSM_EXPORT Result WSM::APICreateMaterial ( size_t  nHistoryID,
const Color nColor,
double  dHorizontalScale,
double  dVerticalScale,
size_t  nTextureID,
size_t &  nMaterialID,
1::string const &  sMaterialName = {},
1::string const &  sMaterialIdentifier = {},
1::vector< 1::pair< 1::string, 1::string >> const *  pAdditionalRenderData = nullptr,
1::vector< 1::pair< 1::string, size_t >> const *  pAdditionalTextures = nullptr 
)

Creates a Material.

The Material stores data of a material and is connected internally to other WSM Objects by MaterialAttributes. Returns the ID of the Material. If nTextureID is WSM::INVALID_ID, no Texture is used. The material name is intended as a user-provided name. The material identifier is intended as a library-provided identifier. The additional data and additional texture parameters are name/value pairs of additional data from the material library. The format of this data is application defined.

Parameters
[in]nHistoryIDID of the given History
[in]nColor
[in]dHorizontalScale
[in]dVerticalScale
[in]nTextureID
[out]nMaterialID
[in]sMaterialName
[in]sMaterialIdentifier
[in]pAdditionalRenderData
[in]pAdditionalTextures
WSM_EXPORT Result WSM::APICreateMaterialWithTexture ( size_t  nHistoryID,
const Color nColor,
double  dHorizontalScale,
double  dVerticalScale,
1::vector< char > const &  aBitmapData,
bool  bUseBitmapAlpha,
size_t &  nMaterialID,
1::string const &  sMaterialName = {},
1::string const &  sMaterialIdentifier = {},
1::vector< 1::pair< 1::string, 1::string >> const *  pAdditionalRenderData = nullptr,
1::vector< 1::pair< 1::string, size_t >> const *  pAdditionalTextures = nullptr,
1::string const &  sTextureName = {} 
)

Creates a Material with a texture.

The Material stores data of a material and is connected internally to other WSM Objects by MaterialAttributes. Returns the ID of the Material. aBitmapData must represent a JPEG or PNG formatted image bUseBitmapAlpha indicates whether or not the alpha channel of the texture should be used. The material name is intended as a user-provided name. The material identifier is intended as a library-provided identifier. The additional data and additional texture parameters are name/value pairs of additional data from the material library. The format of this data is application defined.

Parameters
[in]nHistoryIDID of the given History
[in]nColor
[in]dHorizontalScale
[in]dVerticalScale
[in]aBitmapDataMust represent a JPEG or PNG formatted image
[in]bUseBitmapAlphaIndicates whether the alpha channel of the texture should be used
[out]nMaterialID
[in]sMaterialName
[in]sMaterialIdentifier
[in]pAdditionalRenderData
[in]pAdditionalTextures
[in]sTextureNameIntended as a user-provided name
WSM_EXPORT Result WSM::APICreateMesh ( size_t  nHistoryID,
size_t &  nMeshID,
const 1::vector< float > &  aPoints,
const 1::vector< uint32_t > &  aTriangles,
const 1::vector< float > &  aNormals = {},
const 1::vector< float > &  aUVs = {},
const 1::vector< WSM::Color > &  aColors = {} 
)

Creates a Mesh in the History given by nHistoryID.

nMeshID is the ID of the created Mesh. aPoints must be a non-empty vector of floats where aPoints.size() is divisible by 3. Each 3-tuple of floats in aPoints will be a point in the created Mesh. aTriangles must be a non-empty vector of uint32_ts where aTriangles.size() is divisible by 3. Each 3-tuple of uint32_ts defines a triangle in the Mesh where each uint32_t is an index to a point in aPoints. So the max uint32_t value in aTriangles can be at most aPoints.size() / 3 - 1. aNormals is optional and can be empty. If not empty, it defines a normal at each point in aPoints. In this case each subsequent 3-tuple is a normal and aNormals.size() must equal aPoints.size(). aUVs is optional and can be empty. If not empty, it defines a uv at each point in aPoints. In this case each subsequent 2-tuple is a uv and aUVs.size() / 2 must equal aPoints.size() / 3. aColors is optional and can be empty. If not empty, it defines a color at each point in aPoints. In this case aColors.size() must equal aPoints.size() / 3.

Parameters
[in]nHistoryIDID of the given History
[out]nMeshIDID of the created Mesh
[in]aPointsPoints
[in]aTrianglesTriangles
[in]aNormalsNormals at each point
[in]aUVsUVs at each point
[in]aColorsColors at each point
WSM_EXPORT Result WSM::APICreatePointMesh ( size_t  nHistoryID,
size_t &  nPointMeshID,
const 1::vector< float > &  aPoints 
)

Creates a PointMesh in the History given by nHistoryID.

nPointMeshID is the ID of the created PointMesh. aPoints must be a non-empty vector of floats where aPoints.size() is divisible by 3. Each 3-tuple of floats in aPoints will be a point in the created PointMesh.

Parameters
[in]nHistoryIDID of the given History
[out]nPointMeshIDID of the created PointMesh
[in]aPointsPoints
WSM_EXPORT Result WSM::APICreatePolyline ( size_t  nHistoryID,
const 1::vector< WSM::Point3d > &  aPoints,
size_t &  nCreatedFaceID,
bool  bForceClosed = true 
)

Creates a polyline using 3D sketching not linking with existing topology.

Joins the first and last points if bForceClosed is true. Returns the Face when one is created. Note please use APIConnectPoint3ds, APIConnectVertexAndPoint3d, and APIConnectVertices to link with existing topology - which is what is most often desired.

Parameters
[in]nHistoryIDID of the given History
[in]aPointsThe input list of points
[out]nCreatedFaceIDID of the created Face
[in]bForceClosedSpecifies whether to close the created polyline
WSM_EXPORT Result WSM::APICreateRectangle ( const size_t  nHistoryID,
const WSM::Point3d firstEdgePt1,
const WSM::Point3d firstEdgePt2,
const WSM::Point3d projectionPt,
1::vector< WSM::Point3d > &  aCreatedPts,
bool  bReadOnly = false 
)

Create a rectangle based on one edge and a third point.

firstEdgePt1 and firstEdgePt2 define the first edge of the rectangle. projectionPt is projected onto the plane with origin at firstEdgePt2 and normal towards firstEdgePt1. This projection is the third corner of the rectangle. The fourth corner is calculated from the given three. Parameter aCreatedPts will return a vector of size 4, containing the four corners of the rectangle.

Parameters
[in]nHistoryIDID of the given History
[in]firstEdgePt1The first point defining the given first edge
[in]firstEdgePt2The second point defining the given first edge
[in]projectionPtThe projection point used to determine the third corner of the rectangle.
[out]aCreatedPtsThe returned vector of created points
[in]bReadOnlyIf true, no Objects are created, and only the points are returned
WSM_EXPORT Result WSM::APICreateSatelliteImageObject ( const size_t  nHistoryID,
const 1::string &  sName,
const size_t  nTextureID,
const float  fAlphaValue,
const bool  bFeaturesVisible,
const 1::array< WSM::Point3d, 4 > &  aCorners,
const WSM::Vector2d coordinates,
const WSM::Vector2d coordinatesSpan,
const 1::array< size_t, 2 > &  aPixelDimensions,
size_t &  nObjectID 
)

Creates a satellite image object.

It is similar as APICreateImageObject except that it set satellite data to the new image object. It's associated with a texture, having an alpha value to change its opacity [1.0, 0.0] (totally opaque to totally transparent) bFeaturesVisible is used to show (or not) computer vision recognized data (edges, vertex, etc.) The underlying geometry is represented by 4 corners. It can have a user defined name. Coordinates: (Latitude, Longitude) Coordinates Span: (Latitude Span, Longitude Span) Pixel dimensions: (Width, Height)

Parameters
[in]nHistoryIDID of the given History
[in]sName
[in]nTextureID
[in]fAlphaValue
[in]bFeaturesVisible
[in]aCorners
[in]coordinates
[in]coordinatesSpan
[in]aPixelDimensions
[out]nObjectIDID of the created Object
WSM_EXPORT Result WSM::APICreateSeparateHistoriesForInstances ( size_t  nHistoryID,
1::vector< size_t > const &  aInstanceIDs,
bool  bNewGroupPerInstance,
1::vector< size_t > &  aNewGroupIDs 
)

Creates new copies of the existing groups and the referenced histories for the specified instances.

If bNewGroupPerInstance is true, then each given instance gets a new group and history. If it is false, then any input instances that share a group and history currently will share a new group and history.

Parameters
[in]nHistoryIDID of the given History
[in]aInstanceIDs
[in]bNewGroupPerInstance
[out]aNewGroupIDs
WSM_EXPORT Result WSM::APICreateStringAttribute ( size_t  nHistoryID,
const 1::string &  sKey,
const 1::string &  sValue,
const 1::vector< size_t > &  aObjIDs,
size_t &  nStringAttributeID,
WSM::nCopyBehavior  nCB = WSM::nCopyBehavior::nShareOrCopy,
bool  bIsSharedOnSplit = true 
)

Create a StringAttribute optionally attaching it to the given Objects.

The key must be non-empty or this operation fails. Also, each Object can only have one StringAttribute attached with a given key. It is an error to try to attach a second StringAttribute to an Object with a StringAttribute with the same key. Note this case is an error to avoid the creation of an unused StringAttribute. The migration behavior of the StringAttribute can be specified during copying and splitting. To set the copy behavior use WSM::nCopyBehavior nCB. Two examples are using the array tool and using copy/paste. See WSM_Constants.h for more information. When an Object is split, the StringAttribute will be shared with the split when bIsSharedOnSplit is true. Otherwise the split will not get the StringAttribute. Drawing an line across a Face to divide into 2 Faces is an example of a split.

Parameters
[in]nHistoryIDID of the given History
[in]sKey
[in]sValuenew string value
[in]aObjIDs
[out]nStringAttributeID
[in]nCB
[in]bIsSharedOnSplit
WSM_EXPORT Result WSM::APICreateTexture ( size_t  nHistoryID,
1::vector< char > const &  aBitmapData,
bool  bUseBitmapAlpha,
size_t &  nCreatedTextureID,
1::string const &  sTextureName = {} 
)

Creates a Texture object.

The Texture stores bitmap data to be used by Materials.

Parameters
[in]nHistoryIDID of the given History
[in]aBitmapDataMust represent a JPEG or PNG formatted image
[in]bUseBitmapAlphaIndicates whether the alpha channel of the texture should be used
[out]nCreatedTextureIDID of the created Texture
[in]sTextureNameIntended as a user-provided name
WSM_EXPORT Result WSM::APICreateVertex ( const size_t  nHistoryID,
const WSM::Point3d pos,
size_t &  nCreatedObjectID 
)

Create a Vertex with the given position.

Parameters
[in]nHistoryIDID of the given History
[in]posThe position of the Vertex
[out]nCreatedObjectIDID of the created object
WSM_EXPORT Result WSM::APIDebugObjectReadOnly ( size_t  nHistoryID,
size_t  nObjectID,
1::string &  output 
)

Given an object ID, dump debugging information to 'output'.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectIDID of the given object
[out]output
WSM_EXPORT Result WSM::APIDecodeBase64StringReadOnly ( const 1::string &  base64Str,
size_t &  previousDeltaID,
1::string &  decodedStr 
)

Decode the given base64 encoded string.

If it contains serialized Delta, read the header and extract previousDeltaID. Note this is for internal use only and is not exposed to javascript.

Parameters
[in]base64Str
[out]previousDeltaID
[out]decodedStr
WSM_EXPORT Result WSM::APIDeleteAllHistories ( )

Delete all Histories in WSM and reset next History Id to be 0. This cannot be undone.

WSM_EXPORT Result WSM::APIDeleteAllRedoHistory ( size_t  nHistoryID,
bool  bReuseDiscardedObjectIDs = false 
)

Deletes all forward Deltas.

If bReuseDiscardedObjectIDs is true, all the IDs that are only used in the forward Deltas will be released to be used again as required.

Parameters
[in]nHistoryIDID of the given History
[in]bReuseDiscardedObjectIDsIf true, all Object IDs freed during the operation will be released to be used again as required.
WSM_EXPORT Result WSM::APIDeleteHistory ( size_t  nHistoryID)

Delete a History and all Objects in it.

This cannot be undone.

Parameters
[in]nHistoryIDID of the given History
WSM_EXPORT Result WSM::APIDeleteObject ( size_t  nHistoryID,
size_t  nObjectID 
)

Deletes the given Object including all its children.

Note, the object lives in its History and hence the delete can be undone. Containment of owning Bodies will be fixed if required.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectIDID of the given object
WSM_EXPORT Result WSM::APIDeleteObjects ( size_t  nHistoryID,
const 1::vector< size_t > &  aObjectIDs 
)

Deletes a vector of Objects including all their children.

Note, the Objects live in History so the delete can be undone. Also this API is very forgiving of bad input and will not error in this case. If something cannot be deleted it will be ignored. Containment of owning Bodies will be fixed if required.

Parameters
[in]nHistoryIDID of the given History
[in]aObjectIDsThe given list of Object IDs
WSM_EXPORT Result WSM::APIDetectFreeEdgesReadOnly ( const size_t  nHistoryID,
const 1::vector< size_t > &  aEdgeIDs,
1::vector< size_t > &  aFreeEdgeIDs,
1::vector< size_t > &  aNonFreeEdgeIDs 
)

Takes a list of edges, and returns a list of edges which have 1 or 0 connected faces and a list of the non free edges.

Parameters
[in]nHistoryIDID of the given History
[in]aEdgeIDs
[out]aFreeEdgeIDs
[out]aNonFreeEdgeIDs
WSM_EXPORT Result WSM::APIDetectSilhouettesReadOnly ( const size_t  nHistoryID,
const 1::vector< size_t > &  aEdgeIDs,
const WSM::Point3d cameraPos,
const WSM::Vector3d cameraDir,
bool  bPerspectiveView,
bool  bSmoothOnly,
1::vector< size_t > &  aSilIDs 
)

Takes a list of edge ids and a camera, and returns the ids which contribute to the silhouette.

Parameters
[in]nHistoryIDID of the given History
[in]aEdgeIDs
[in]cameraPosPoint3d for the eye of the camera
[in]cameraDirVector3d for the direction of the camera
[in]bPerspectiveViewTrue if in perspective view
[in]bSmoothOnlyIf true, only smooth edge are considered to contribute to the silhouette.
[out]aSilIDs
WSM_EXPORT Result WSM::APIDisableJournaling ( 1::string *  journalOutput = nullptr)

Disable Journaling.

If journalOutput != null then journalOutput will be assigned the journal file.

Parameters
[out]journalOutput
WSM_EXPORT Result WSM::APIDragFace ( size_t  nHistoryID,
size_t  nFaceID,
double  dDist,
bool  bMerge = false 
)

Drags a Face in the direction of its normal by the given distance.

Creates a Body to own the dragged Face if not previously owned.

Parameters
[in]nHistoryIDID of the given History
[in]nFaceIDID of the given Face
[in]dDistThe given drag distance
[in]bMergeIf true, merges out Edges in the newly created Face.
WSM_EXPORT Result WSM::APIDragFaces ( size_t  nHistoryID,
const 1::vector< 1::vector< size_t >> &  aaFaceIDs,
const 1::vector< double > &  aDists,
const 1::vector< WSM::UnitVector3d > *  aDirs = nullptr,
bool  bMerge = false 
)

Drag multiple Faces, in the same manner as APIDragFace().

Creates Bodies to own any dragged faces not previously owned. NOTE: Each component vector of aaFaceIDs currently may only contain one face. More will be allowed in the future.

Parameters
[in]nHistoryIDID of the given History
[in]aaFaceIDsThe given list of vectors of faces to be dragged, specified by ID.
[in]aDistsThe given list of drag distances, one for each given vector of faces. Must be the same length as aaFaceIDs. For example, all faces in aaFaceIDs[0] are dragged by distance aDists[0].
[in]aDirsAn optional list of drag directions, one for each vector of faces. If provided, must be the same length as aaFaceIDs. If not provided, faces are dragged in their normal direction.
[in]bMergeIf true, merges out Edges in the newly created Face.
WSM_EXPORT Result WSM::APIEditCircleEdges ( size_t  nHistoryID,
1::vector< size_t >  nEdgeIDs,
double  radius,
const WSM::Point3d center,
const WSM::UnitVector3d normal,
const WSM::UnitVector3d xaxis,
double  angle = 0.0 
)

Edits the circle data of the Edges with nEdgeIDs when the Edges lies on a circle.

The radius, center, normal and x axis must all be specified so it is best to call APIIsEdgeOnCircleReadOnly() to get the parameters and then call APIEditCircleEdges() with the changed parameters. The xaxis parameter is only used when the angle is greater than zero. Otherwise it does not come into play and is disregarded. Angle of the sweep of the arc measured CCW from the xaxis. A zero angle is the default value meaning parameter is not used and the angle of the circle is not to be changed. If the given edges are not on the same circle the API will error.

Parameters
[in]nHistoryIDID of the given History
[in]nEdgeIDsID list of the given edges
[in]radiusThe given radius
[in]centerThe given center position
[in]normalThe given normal unit vector
[in]xaxisThe given x-axis unit vector (used if angle is not zero)
[in]angleThe give angle of sweep from the xaxis CCW.
WSM_EXPORT Result WSM::APIEditCylinderFaces ( size_t  nHistoryID,
1::vector< size_t >  nFaceIDs,
double  radius,
const WSM::Point3d center,
const WSM::UnitVector3d normal,
const WSM::UnitVector3d xaxis 
)

Edits the Cylinder data of the given Faces when the Faces lies on a cylinder.

The radius, center, normal and x axis must all be specified so it is best to call APIIsFaceOnCylinderReadOnly to get the parameters and then call APIEditCylinderFaces with the changed parameters. If the faces are not on the same cylinder the API will error.

Parameters
[in]nHistoryIDID of the given History
[in]nFaceIDs
[in]radiusThe given radius
[in]centerThe given center position
[in]normalThe given normal unit vector
[in]xaxisThe given x-axis unit vector
WSM_EXPORT Result WSM::APIEditSphereFaces ( size_t  nHistoryID,
1::vector< size_t >  nFaceIDs,
double  radius,
const WSM::Point3d center,
const WSM::UnitVector3d normal,
const WSM::UnitVector3d xaxis 
)

Edits the Sphere data of the given Faces when the Faces lies on a sphere.

The radius, center, normal and xaxis must all be specified so it is best to call APIIsFaceOnSphereReadOnly() to get the parameters and then call APIEditSphereFaces() with the changed parameters. If the faces are not on the same sphere the API will error.

Parameters
[in]nHistoryIDID of the given History
[in]nFaceIDs
[in]radiusThe given radius
[in]centerThe given center position
[in]normalThe given normal unit vector
[in]xaxisThe given x-axis unit vector
WSM_EXPORT Result WSM::APIEditSplineEdges ( size_t  nHistoryID,
1::vector< size_t >  nEdgeIDs,
const 1::vector< WSM::Point3d > &  aControlPoints,
bool  bClosed,
const WSM::Vector3d startTangent,
const WSM::Vector3d endTangent 
)

Edit the spline data of the Edge with nEdgeIDs when the Edge lies on a spline.

The control points, closed, start tangent, and end tangent must all be specified so it is best to call APIIsEdgeOnSplineReadOnly() to get the parameters and then call APIEditSplineEdges() with the changed parameters. If the given edges are not on the same spline the API will error.

Parameters
[in]nHistoryIDID of the given History
[in]nEdgeIDsID list of the given edges
[in]aControlPointsThe given vector of spline control points
[in]bClosedSpecifies whether the spline end point is the start point, i.e. whether the curve must be smooth and closed.
[in]startTangentThe given tangent vector at the spline start point
[in]endTangentThe given tangent vector at the spline end point
WSM_EXPORT Result WSM::APIEnableJournaling ( size_t  nHistoryID,
const 1::string &  sJournalFileName = {} 
)

Enable Journaling.

If sJournalFileName is empty (default), then the journal will be stored as a string. Use Result APIDisableJournaling(std::string &) to retrieve the string.

Parameters
[in]nHistoryIDID of the given History
[in]sJournalFileName
WSM_EXPORT Result WSM::APIEnableJournalingTypes ( const 1::vector< 1::string > &  types,
bool  add = false 
)

First turns off all journaling types if add is false, and then turns on all types in the given list of types.

Types available: WSM: "WSM", "WSMReadOnly", WSMInferenceEngine: "WSMInferenceEngine" WSMTools: "WSMTools", "WSMToolsPicking", "WSMToolsConcrete", "WSMToolsReadOnly"

Parameters
[in]typesThe given list of types
[in]addSpecifies whether to first turn off all journaling types before enabling the given types.
WSM_EXPORT Result WSM::APIExtrudeEdges ( size_t  nHistoryID,
const 1::vector< size_t > &  aEdgeIDs,
const WSM::Transf3d t 
)

Makes a Face from the given set of continuous edges and a transformed copy of the edges.

Parameters
[in]nHistoryIDID of the given History
[in]aEdgeIDs
[in]tThe given transformation
WSM_EXPORT Result WSM::APIFaceContainsPointReadOnly ( const size_t  nHistoryID,
const size_t  nFaceID,
const Point3d point,
bool &  bContainsPoint 
)

Does the given Face contain the given Point3d?

Parameters
[in]nHistoryIDID of the given History
[in]nFaceIDID of the given Face
[in]pointThe given point
[out]bContainsPointReturns true if the given Face contains the given point
WSM_EXPORT Result WSM::APIFlattenFaces ( size_t  nHistoryID,
const 1::vector< size_t > &  aFaceIDs,
double  dTol = WSM_DISTANCE_TOL 
)

Flattens all Faces given by aFaceIDs onto the plane of the first Face when all Faces lie within dTol of the first Face's plane, then merges into a single Face.

Note dTol is a relative tolerance based on the size of the bounding boxes of the given Faces.

Parameters
[in]nHistoryIDID of the given History
[in]aFaceIDsID list of the given Faces
[in]dTolThe maximum relative amount a Face can be moved.
WSM_EXPORT Result WSM::APIFlattenGroupsOrInstances ( size_t  nHistoryID,
1::vector< size_t > const &  aGroupOrInstanceIDs,
bool  bRecursive,
bool  bImprint 
)

Replace the instances and/or groups referenced in aGroupOrInstanceIDs by a copy of the contents of the referenced history.

If bRecursive is true, repeat the process for all the new groups created by the copy. If bImprint is true, top level edges and faces from the group are imprinted into the model. If bImprint is false, top level edges become line meshes and top level faces are put into bodies.

Parameters
[in]nHistoryIDID of the given History
[in]aGroupOrInstanceIDs
[in]bRecursive
[in]bImprint
WSM_EXPORT Result WSM::APIGetAllAggregateTransf3dsReadOnly ( size_t  nReferencedHistoryID,
size_t  nTopMostHistoryID,
1::vector< WSM::Transf3d > &  aGroupAggregateTransf3dVec,
1::vector< GroupInstancePath > &  aTransformPaths 
)

Computes all the global Transf3ds on the given History referenced by a Group stopping at nTopMostHistoryID.

The vector of Transf3ds will be empty when the History is not the referenced History of a Group. The aTransformPaths parameter will have the same size as the array of transforms, and will contain the GroupInstancePath for the instance for each transform.

Parameters
[in]nReferencedHistoryID
[in]nTopMostHistoryID
[out]aGroupAggregateTransf3dVec
[out]aTransformPaths
WSM_EXPORT Result WSM::APIGetAllConnectedNonOwnedReadOnly ( const size_t  nHistoryID,
const size_t  nObjectID,
1::vector< size_t > &  aNonOwned 
)

Returns all non owned Objects in the given History that are connected to the given Object.

Note, this is a read-only operation. Note, Edges that are not inside a Face as always top level Edges even when connected to a Body. For example, 2 cubes connected by an Edge between Vertices from each cube is made up of 3 top levels, 2 Bodies and 1 Edge.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectIDID of the given Object
[out]aNonOwned
WSM_EXPORT Result WSM::APIGetAllHistoriesReadOnly ( 1::vector< size_t > &  aIDs,
bool  bWantTemporary = false 
)

Gets a sorted vector of the IDs of all active histories, optionally excluding temporary.

Parameters
[out]aIDsThe returned vector of IDs
[in]bWantTemporaryIf true, temporary histories will be included.
WSM_EXPORT Result WSM::APIGetAllHistoryDeltasReadOnly ( size_t  nHistoryID,
1::vector< size_t > &  aDeltaIDs 
)

Get the IDs of all deltas in the given history.

Parameters
[in]nHistoryIDID of the given History
[out]aDeltaIDsThe returned list of Delta IDs
WSM_EXPORT Result WSM::APIGetAllNonOwnedReadOnly ( const size_t  nHistoryID,
1::vector< size_t > &  aNonOwned 
)

Returns all non owned Objects in the given History.

Note, this is a read-only operation.

Parameters
[in]nHistoryIDID of the given History
[out]aNonOwned
WSM_EXPORT Result WSM::APIGetAllObjectsByTypeReadOnly ( const size_t  nHistoryID,
const WSM::nObjectType  nType,
1::vector< size_t > &  aIDs 
)

Returns all live objects of type nType in the given history.

Return all objects when nType is WSM::nUnSpecifiedType. Note this is a read-only operation.

Parameters
[in]nHistoryIDID of the given History
[in]nTypeThe given object type filter
[out]aIDsThe returned vector of IDs
WSM_EXPORT Result WSM::APIGetAllReachableHistoriesReadOnly ( size_t  nHistoryID,
bool  bGoUp,
1::vector< size_t > &  aHistoryIDs 
)

Gets all the Histories reachable from the given History going either up or down the chain of Histories based on the flag bGoUp.

Note, includes itself.

Parameters
[in]nHistoryIDID of the given History
[in]bGoUpSpecifies whether to go up (true) or down the chain of Histories
[out]aHistoryIDsThe returned list of of History IDs
WSM_EXPORT Result WSM::APIGetBodyEdgesReadOnly ( const size_t  nHistoryID,
const size_t  nBodyID,
1::vector< size_t > &  aEdgeIDs 
)

Returns the Edges of a Body.

Note this is a read-only operation.

Parameters
[in]nHistoryIDID of the given History
[in]nBodyIDID of the given Body
[out]aEdgeIDsThe returned vector of Edge IDs
WSM_EXPORT Result WSM::APIGetBodyFacesReadOnly ( const size_t  nHistoryID,
const size_t  nBodyID,
1::vector< size_t > &  aFaceIDs 
)

Returns the Faces of a Body.

Note this is a read-only operation.

Parameters
[in]nHistoryIDID of the given History
[in]nBodyIDID of the given Body
[out]aFaceIDsThe returned vector of Face IDs
WSM_EXPORT Result WSM::APIGetBoxReadOnly ( const size_t  nHistoryID,
const size_t  nObjectID,
WSM::Interval3d Box,
const WSM::Transf3d transform = WSM::Transf3d::kIdentity 
)

Returns the bounding box of a Object.

If the given object ID is WSM::INVALID_ID, returns the bounding box of the given history. Note this is a read-only operation. If transform is given, the bounding box is computed for the transformed Object or History.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectIDID of the given Object
[out]BoxThe returned bounding box
[in]transformBox based on optional transform
WSM_EXPORT Result WSM::APIGetCoedgeDirectionReadOnly ( size_t  nHistoryID,
const size_t  nObjectID,
bool &  bForward 
)

Return true if cedge and its underlying edge go in the same direction; otherwise, return false.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectIDID of the given Object
[out]bForward
WSM_EXPORT Result WSM::APIGetConnectedEdgesReadOnly ( const size_t  nHistoryID,
const size_t  nEdgeID,
1::vector< size_t > &  aConnectedEdges,
bool  bBreakOnNonSmooth 
)

Returns all connected edges of a seed edge.

Connections stop when it finds a vertex with 3 or more non-smooth edges or if the bBreakOnNonSmooth is true stops at non-smooth vertex. Note, this is a read-only operation.

Parameters
[in]nHistoryIDID of the given History
[in]nEdgeIDID of the given Edge
[out]aConnectedEdges
[in]bBreakOnNonSmooth
WSM_EXPORT Result WSM::APIGetConvexityConnectedComponentReadOnly ( size_t  nHistoryID,
size_t  nFaceID,
size_t  nConvexity,
1::vector< size_t > &  aConnectedFaces 
)

Using the given FaceID, finds all Faces connected across Edges, as controlled by nConvexity.

See enumerated type WSM::nConvexity for supported values. The connected component includes the starting Face as the first face in the vector.

Parameters
[in]nHistoryIDID of the given History
[in]nFaceIDID of the given Face
[in]nConvexityThe given convexity filter, defined as a bitfield value of enumerated type WSM::nConvexity.
Valid values include: WSM::nConvexitySmooth, WSM::nConvexityConcave, or WSM::nConvexityConvex.
An error is returned if WSM::nConvexityUnset or WSM::nConvexityMixed is given.
[out]aConnectedFacesThe returned ID list of connected Faces, including the starting face as the first face in the vector.
WSM_EXPORT Result WSM::APIGetConvexityReadOnly ( size_t  nHistoryID,
size_t  nEdgeOrLoopID,
WSM::nConvexity eConvextity 
)

Get a Loop or Edge convexity.

Parameters
[in]nHistoryIDID of the given History
[in]nEdgeOrLoopIDID of the given Loop or Edge
[out]eConvextityThe returned convexity
WSM_EXPORT Result WSM::APIGetCreatedChangedAndDeletedInActiveDeltaReadOnly ( size_t  nHistoryID,
1::vector< size_t > *  paCreated,
1::vector< size_t > *  paChanged,
1::vector< size_t > *  paDeleted,
WSM::nObjectType  nType,
bool  bForUndo = false 
)

Gets the changed, created, and deleted objects in the most recent delta.

Any vector for which the information is not needed can be nullptr. nType specifies what type of objects to grab. If nUnspecified, return all objects. If bForUndo is true, get the changes caused by the most recent undo, meaning that objects created in the forward action are deleted by the undo, and vice versa. If no deltas are available past the current one and bForUndo is true, the API returns the WSM::nBadInput error result.

Parameters
[in]nHistoryIDID of the given History
[out]paCreated
[out]paChanged
[out]paDeleted
[in]nType
[in]bForUndo
WSM_EXPORT Result WSM::APIGetCreatedChangedAndDeletedInDeltaRangeReadOnly ( size_t  nHistoryID,
size_t  previousDeltaID,
size_t  currentDeltaID,
1::vector< size_t > *  paCreated,
1::vector< size_t > *  paChanged,
1::vector< size_t > *  paDeleted,
1::vector< WSM::nObjectType > const &  aTypes 
)

Gets the changed, created, and deleted objects between the previous and current Delta in the range of Deltas provided.

This represents the objects affected in the Deltas in the half-open range (previous, current] when current > previous (redo or state closed) and in the half-open range (current, previous] otherwise, which is for undo. Accepts the WSM::INVALID_ID flag to indicate the beginning of history.

Any vector for which the information is not needed can be nullptr.

The aTypes parameter specifies what types of objects to grab. If empty, return all objects.

Returns an error for an empty range or an invalid Delta ID.

Parameters
[in]nHistoryIDID of the given History
[in]previousDeltaID
[in]currentDeltaID
[out]paCreated
[out]paChanged
[out]paDeleted
[in]aTypes
WSM_EXPORT Result WSM::APIGetDatabaseVersionReadOnly ( size_t &  nMajorVer,
size_t &  nMinorVer 
)

Returns the Major and Minor software versions which is used when saving and loading files and strings.

Parameters
[out]nMajorVerThe major software version
[out]nMinorVerThe minor software version
WSM_EXPORT Result WSM::APIGetDeltaFlagsReadOnly ( size_t  nHistoryID,
size_t  nDeltaID,
size_t &  nDeltaFlags 
)

Get flags of Delta with ID of nDeltaID in History nHistoryID.

Note this is for internal use only and is not exposed to javascript.

Parameters
[in]nHistoryIDID of the given History
[in]nDeltaIDID of the given Delta
[out]nDeltaFlags
WSM_EXPORT Result WSM::APIGetDynamoModelInformationReadOnly ( size_t  nHistoryID,
1::string &  id,
1::string *  name = nullptr,
1::string *  config = nullptr,
1::string *  delta = nullptr 
)

Get Dynamo Model information of the specific history.

If the history was generated from Dynamo Model, the API will return good and contain data in out parameters.

Parameters
[in]nHistoryIDID of the given History
[out]id
[out]name
[out]config
[out]delta
WSM_EXPORT Result WSM::APIGetEdgeFaceClassificationReadOnly ( const size_t  nHistoryID,
const 1::vector< size_t > &  aEdgeIDs,
1::vector< int > &  aFaceClassification 
)

Takes a list of edges, and returns an array of int that describes the edge face classification for each edge.

0 = free edge, 1 = single face edge, -1 = spur edge, 2 = edge references 2 or more edges. This APIs main use is for efficient rendering.

Parameters
[in]nHistoryIDID of the given History
[in]aEdgeIDs
[out]aFaceClassification
WSM_EXPORT Result WSM::APIGetEdgeOrVertexMarkedSmoothReadOnly ( const size_t  nHistoryID,
const size_t  nObjectID,
bool &  bIsSmooth 
)

Returns whether an edge or vertex is marked as smooth.

If bIsSmooth is returned 'false', this may mean either that the object is non-smooth or its smoothness is unknown. Note, this is a read-only operation.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectIDID of the given Object
[out]bIsSmooth
WSM_EXPORT Result WSM::APIGetEdgePointsReadOnly ( size_t  nHistoryID,
size_t  nEdgeID,
WSM::Point3d start,
WSM::Point3d end 
)

Get edge endpoints directly.

Parameters
[in]nHistoryIDID of the given History
[in]nEdgeID
[out]start
[out]end
WSM_EXPORT Result WSM::APIGetEdgeStyleReadOnly ( size_t  nHistoryID,
size_t  nObjectID,
Color nColor 
)

Get the style of an edge.

If no style is found, the color defaults to black (0). Note only Edges, Instances, and LineMeshes can have edge styles.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectIDID of the given object
[out]nColor
WSM_EXPORT Result WSM::APIGetEnabledJournalingTypesReadOnly ( 1::set< 1::string > &  types)

Returns the list of journaling types that are enabled.

Parameters
[out]typesThe returned list of enabled journaling types
WSM_EXPORT Result WSM::APIGetFaceBacksideMaterialReadOnly ( size_t  nHistoryID,
size_t  nFaceID,
size_t &  nMaterialID 
)

Gets the backside material of the given face.

Parameters
[in]nHistoryIDID of the given History
[in]nFaceIDID of the given Face
[out]nMaterialID
WSM_EXPORT Result WSM::APIGetFaceCentroidPoint3dReadOnly ( size_t  nHistoryID,
size_t  nFaceID,
WSM::Point3d centroidPt 
)

Get a Face centroid point.

Parameters
[in]nHistoryIDID of the given History
[in]nFaceIDID of the given Face
[out]centroidPtThe returned centroid point
WSM_EXPORT Result WSM::APIGetFaceConnectedComponentReadOnly ( size_t  nHistoryID,
size_t  nFaceID,
bool  bUseVertices,
bool  bSmooth,
1::vector< size_t > &  aConnectedFaces 
)

Using the given Face ID, finds all Faces connected across Edges or Vertices, as controlled by bUseVertices and bSmooth.

bSmooth is only used on edges when bUseVertices is false. The connected component includes the starting Face.

Parameters
[in]nHistoryIDID of the given History
[in]nFaceIDID of the given Face
[in]bUseVerticesIf true, vertices are used to find connected faces, otherwise, edges are used.
[in]bSmoothIf true and bUseVertices is false, only smooth edges are considered.
[out]aConnectedFacesThe returned ID list of connected Faces, including the starting face as the first face in the vector.
WSM_EXPORT Result WSM::APIGetFaceFacetsReadOnly ( const size_t  nHistoryID,
const size_t  nFaceID,
1::vector< size_t > &  aFacets 
)

Returns the Facets of a Face.

The facet vector contains Vertex IDs, where 3 consecutive Vertices define each triangle. Note this is a read-only operation.

Parameters
[in]nHistoryIDID of the given History
[in]nFaceIDID of the given Face
[out]aFacets
WSM_EXPORT Result WSM::APIGetFacePlaneReadOnly ( const size_t  nHistoryID,
const size_t  nFaceID,
WSM::Plane plane 
)

Get the Face Plane.

Note this is a read-only operation.

Parameters
[in]nHistoryIDID of the given History
[in]nFaceIDID of the given Face
[out]planeThe returned Face Plane
WSM_EXPORT Result WSM::APIGetFaceUVDataAttributeUVsReadOnly ( const size_t  nHistoryID,
const size_t  nFaceUVDataAttributeID,
1::vector< Point2d > &  aFrontUVs,
1::vector< Point2d > &  aBackUVs,
1::vector< size_t > *  pVertexIDs = nullptr 
)

Gets the UVs from a FaceUVDataAttribute.

Note either the number of front UVs equals the number of Vertices on the owning Face and are in the same order, or there are none. The same condition applies to back UVs. Optionally returns the Vertices in order from the owning Face.

Parameters
[in]nHistoryIDID of the given History
[in]nFaceUVDataAttributeIDID of the given FaceUVDataAttribute
[out]aFrontUVsThe front UVs.
[out]aBackUVsThe back UVs.
[out]pVertexIDsVertexIDs corresponding to the UVs.
WSM_EXPORT Result WSM::APIGetFaceUVDataTransformReadOnly ( const size_t  nHistoryID,
const size_t  nFaceID,
WSM::Transf3d rTransf3d,
WSM::Transf3d planeTransf3d = nullptr,
bool  bBackSide = false 
)

Gets the 2d transform, returned as a 3d transform, for the uvs on the given Face.

If the Face has no FaceUVDataAttribute, this transformation will be the identity. If the Face has transformed uvs, the returned transform can be passed to APISetFaceUVDataAttributes to transform the uvs for a Face with the flag bPostTransform set to true. If bBackSide is true, gets the transform for the back Material uvs otherwise gets the front uvs transform. Note uv translation is not returned as this is not helpful when applying the map to new Faces. Optionally the 3d transform which describes the 3d plane in which the face's texture is rendered can be returned. This plane has the face normal as the z axis but also defines the x and y axes along which the texture is oriented on the face.

Parameters
[in]nHistoryIDID of the given History
[in]nFaceIDThe Face whose uv transform is returned
[out]rTransf3dThe transform that was applied to the uvs
[out]planeTransf3dOptional transform that describes the 3d plane in which the face's texture is rendered
[in]bBackSideIf true, computes the back uv transform.
WSM_EXPORT Result WSM::APIGetFaceVariantReadOnly ( size_t  nHistoryID,
size_t  nFaceID,
double &  dVariant 
)

Get a Face variant.

Parameters
[in]nHistoryIDID of the given History
[in]nFaceIDID of the given Face
[out]dVariantThe returned Face variant
WSM_EXPORT Result WSM::APIGetFaceVertexNormalsReadOnly ( const size_t  nHistoryID,
const size_t  nFaceID,
1::vector< 1::pair< size_t, WSM::UnitVector3d > > &  aVertexNormals 
)

Get normals for each Vertex of the given Face, averaging face normals across smooth edges.

Note this is a read-only operation.

Parameters
[in]nHistoryIDID of the given History
[in]nFaceIDID of the given Face
[out]aVertexNormalsThe returned vertex normals
WSM_EXPORT Result WSM::APIGetGroupReferencedHistoryReadOnly ( size_t  nHistoryID,
size_t  nGroupOrInstanceID,
size_t &  nReferencedHistoryID,
bool  bDeletedInstanceOK = false,
int  nDeltaOffset = 0 
)

Returns the ID of the Group's or Instance's referenced History.

Parameters
[in]nHistoryIDID of the given History
[in]nGroupOrInstanceID
[out]nReferencedHistoryID
[in]bDeletedInstanceOKIf true, gets the referenced History ID even from a deleted Instance.
[in]nDeltaOffsetIf nDeltaOffset is not zero, uses the group or instance from the delta specified by the offset from the current delta. 0 means, use the current delta.
WSM_EXPORT Result WSM::APIGetHistoryDeltasReadOnly ( size_t  nHistoryID,
size_t  nStartDeltaID,
size_t  nEndDeltaID,
1::vector< size_t > &  aDeltaIDs 
)

Get the IDs of the deltas in the given closed range in the given history.

Accepts the WSM::INVALID_ID flag to indicate the beginning of history. In that case only, the WSM::INVALID_ID value will be included in the vector.

Parameters
[in]nHistoryIDID of the given History
[in]nStartDeltaIDFirst Delta ID in the target range
[in]nEndDeltaIDLast Delta ID in the target range
[out]aDeltaIDsThe returned list of Delta IDs
WSM_EXPORT Result WSM::APIGetHistoryReferencingGroupsReadOnly ( size_t  nHistoryID,
1::vector< WSM::ObjectHistoryID > &  aObjectIDs 
)

Returns a vector with groups that reference this history.

Parameters
[in]nHistoryIDID of the given History
[out]aObjectIDs
WSM_EXPORT Result WSM::APIGetIdOfActiveDeltaReadOnly ( size_t  nHistoryID,
size_t &  nActiveDeltaID,
int  nDeltaOffset = 0 
)

Get the active Delta ID.

If nDeltaOffset is non-zero, the API looks back (in Undo direction) for negative nDeltaOffset or forward (as Redo) for positive value at nDeltaOffset Deltas from the active Delta and gets its ID.

Parameters
[in]nHistoryIDID of the given History
[out]nActiveDeltaIDThe returned ID of the target Delta
[in]nDeltaOffsetThe forward (positive) or backwards (negative) offset between the target Delta and the active Deltas
WSM_EXPORT Result WSM::APIGetImageDataReadOnly ( const size_t  nHistoryID,
const size_t  nImageID,
1::string &  sName,
size_t &  nTextureID,
size_t &  nPosition,
float &  fAlphaValue,
bool &  bFeaturesVisible,
1::array< WSM::Point3d, 4 > &  aCorners,
bool &  bHasSatelliteData 
)

Gets the image data.

Parameters
[in]nHistoryIDID of the given History
[in]nImageID
[out]sName
[out]nTextureID
[out]fAlphaValue
[out]bFeaturesVisible
[out]aCorners
[out]bHasSatelliteData
Parameters
nPositionZ sorting
WSM_EXPORT Result WSM::APIGetInstanceTransf3dReadOnly ( size_t  nHistoryID,
size_t  nInstanceID,
WSM::Transf3d rTransf3d 
)

Returns the Instance's Transf3d.

Parameters
[in]nHistoryIDID of the given History
[in]nInstanceID
[out]rTransf3dThe transform that was applied to the uvs
WSM_EXPORT Result WSM::APIGetLastDeltaIDReadOnly ( size_t  nHistoryID,
size_t &  nLastDeltaID,
size_t  nBeforeLast = 0 
)

Get the ID of the target Delta, which is nBeforeLast before the last Delta (even for zero nBeforeLast, it may be different from the active Delta ID, if there are available Redo states).

Parameters
[in]nHistoryIDID of the given History
[out]nLastDeltaIDThe returned ID of the target Delta
[in]nBeforeLastThe offset between the target Delta and the last Delta
WSM_EXPORT Result WSM::APIGetLayerDataReadOnly ( size_t  nHistoryID,
size_t  nLayerID,
1::string &  name,
bool &  bDisplayed,
1::vector< size_t > *  aObjectsUsingLayer = nullptr 
)

Get the data from a layer.

If aObjectsUsingLayer is non NULL, all obejcts that use this layer are returned in the vector

Parameters
[in]nHistoryIDID of the given History
[in]nLayerID
[out]name
[out]bDisplayed
[out]aObjectsUsingLayer
WSM_EXPORT Result WSM::APIGetLevelDataReadOnly ( const size_t  nHistoryID,
const size_t  nLevelID,
1::string &  sLevelName,
double &  dElevation 
)

Gets the Level´s data.

Parameters
[in]nHistoryIDID of the given History
[in]nLevelID
[out]sLevelName
[out]dElevation
WSM_EXPORT Result WSM::APIGetLineMeshDataReadOnly ( size_t  nHistoryID,
size_t  nLineMeshID,
1::vector< float > &  aPoints,
1::vector< uint32_t > &  aIndices,
1::vector< uint32_t > &  aCounts 
)

Returns all the data from a LineMesh.

aPoints.size() is divisible by 3. Each 3-tuple of floats in aPoints is a point in the LineMesh. aIndices is a vector of indices, where the ith index corresponds to the point (aPoints[3 * aIndices[i]], aPoints[3 * aIndices[i] + 1], aPoints[3 * aIndices[i] + 2]). aCounts is a monotonically increasing vector that describes connected line segments where the number of points that make up the connected segments in the ith polyline is given by aCounts[i] - aCounts[i - 1] and the points in the ith segment are given by aIndices[aCounts[i - 1]], aIndices[aCounts[i - 1] + 1], ..., aIndices[aCounts[i] - 1]. For example if the aCounts vector is [5, 8, 12] then the first line is formed by connecting the point given by aIndices[0] to the point given by aIndices[1] to aIndices[2] to aIndices[3] to aIndices[4]. The second line connects aIndices[5] to aIndices[6] to aIndices[7]. The third line is from aIndices[8] to aIndices[9] to aIndices[10] to aIndices[11].

Parameters
[in]nHistoryIDID of the given History
[in]nLineMeshIDID of the given LineMesh
[out]aPointsPoints
[out]aIndicesIndices
[out]aCountsCounts
WSM_EXPORT Result WSM::APIGetLocalCoordinateSystemReadOnly ( const size_t  nHistoryID,
Transf3d LCS 
)

Get the LCS (local coordinate system) of the given History.

Parameters
[in]nHistoryIDID of the given History
[out]LCS
WSM_EXPORT Result WSM::APIGetMaterialDataReadOnly ( const size_t  nHistoryID,
const size_t  nMaterialID,
Color nColor,
double &  dHorizontalScale,
double &  dVerticalScale,
size_t &  nTextureID,
1::string *  pMaterialName = nullptr,
1::string *  pMaterialIdentifier = nullptr,
1::vector< 1::pair< 1::string, 1::string >> *  pAdditionalRenderData = nullptr,
1::vector< 1::pair< 1::string, size_t >> *  pAdditionalTextures = nullptr,
1::vector< size_t > *  aObjectsUsingMaterial = nullptr 
)

Gets the material data of a Material.

The material name is intended as a user-provided name. The material identifier is intended as a library-provided identifier. The additional data and additional texture parameters are name/value pairs of additional data from the material library. The format of this data is application defined. If aObjectsUsingMaterial is non NULL, all objects that use this material are returned in the vector

Parameters
[in]nHistoryIDID of the given History
[in]nMaterialID
[out]nColor
[out]dHorizontalScale
[out]dVerticalScale
[out]nTextureID
[out]pMaterialName
[out]pMaterialIdentifier
[out]pAdditionalRenderData
[out]pAdditionalTextures
[out]aObjectsUsingMaterial
WSM_EXPORT Result WSM::APIGetMemorySizeReadOnly ( const size_t  nHistoryID,
size_t &  nBytes,
bool  bCollapsedHistoryWithLiveObjsOnly = false 
)

Returns the size (in bytes) of either the current History with all Object versions or collapsed history with only live Objects.

Note, this is a read-only operation.

Parameters
[out]nBytesThe returned memory size (in bytes)
[in]nHistoryIDID of the given History
[in]bCollapsedHistoryWithLiveObjsOnly
WSM_EXPORT Result WSM::APIGetMeshDataReadOnly ( size_t  nHistoryID,
size_t  nMeshID,
1::vector< float > &  aPoints,
1::vector< uint32_t > &  aTriangles,
1::vector< float > *  pNormals = nullptr,
1::vector< float > *  pUVs = nullptr,
1::vector< WSM::Color > *  pColors = nullptr 
)

Returns all the data from a Mesh.

aPoints.size() is divisible by 3. Each 3-tuple of floats in aPoints is a point in the Mesh. aTriangles.size() is divisible by 3. Each 3-tuple of uint32_ts in aTriangles defines a triangle in the Mesh where each uint32_t is an index to a point in aPoints. So the max uint32_t value in aTriangles can be at most aPoints.size() / 3 - 1. pNormal, pUVs, and pColors are optional and can be nullptr. If set to nullptr, no data will be returned. pNormals can be empty. If not empty, it defines a normal at each point in aPoints. In this case each subsequent 3-tuple is a normal and pNormals->size() must equal aPoints.size(). pUVs can be empty. If not empty, it defines a uv at each point in aPoints. In this case each subsequent 2-tuple is a uv and pUVs->size() / 2 must equal aPoints.size() / 3. pColors can be empty. If not empty, it defines a color at each point in aPoints. In this case pColors->size() must equal aPoints.size() / 3.

Parameters
[in]nHistoryIDID of the given History
[in]nMeshIDID of the given Mesh
[out]aPointsPoints
[out]aTrianglesTriangles
[out]pNormalsNormals at each point
[out]pUVsUVs at each point
[out]pColorsColors at each point
WSM_EXPORT Result WSM::APIGetObjectAttributesReadOnly ( size_t  nHistoryID,
size_t  nObjectID,
1::vector< size_t > &  aAttributeIDs 
)

Get all of the Attributes of the given Object.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectIDID of the given object
[out]aAttributeIDs
WSM_EXPORT Result WSM::APIGetObjectLayersReadOnly ( size_t  nHistoryID,
size_t  nObjectID,
1::vector< size_t > &  aLayerIDs 
)

Get all the layers of the given Object.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectIDID of the given object
[out]aLayerIDs
WSM_EXPORT Result WSM::APIGetObjectLevelsReadOnly ( const size_t  nHistoryID,
const size_t  nObjectID,
1::vector< size_t > &  aLevelsIDs 
)

Get the levels associated with an object (body)

Parameters
[in]nHistoryIDID of the given History
[in]nObjectIDID of the given Object
[out]aLevelsIDs
WSM_EXPORT Result WSM::APIGetObjectMaterialReadOnly ( size_t  nHistoryID,
size_t  nObjectID,
size_t &  nMaterialID 
)

Gets the material of the object.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectIDID of the given object
[out]nMaterialID
WSM_EXPORT Result WSM::APIGetObjectNameReadOnly ( size_t  nHistoryID,
size_t  nObject,
const char *&  pName 
)

Returns the name of the Object.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectID of the given Object
[in]pName
WSM_EXPORT Result WSM::APIGetObjectPropertiesReadOnly ( const size_t  nHistoryID,
const size_t  nObjectID,
1::string &  sObjectName,
bool &  bReportAreaByLevel 
)

Gets the properties of a given object (Body): A name and if that particular body reports its area by level or not.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectIDID of the given Object
[out]sObjectName
[out]bReportAreaByLevel
WSM_EXPORT Result WSM::APIGetObjectsByTypeReadOnly ( const size_t  nHistoryID,
const size_t  nObjectID,
const WSM::nObjectType  nType,
1::vector< size_t > &  aIDs,
bool  bUpstream = false 
)

If the given bUpstream argument is false, returns all the objects of type nType contained by the given pbject; otherwise, returns all the objects of type nType which are the parents of given object.

Includes itself if nObjectID is of the given nType. Also return all objects when nType is WSM::nUnSpecifiedType. Note this is a read-only operation.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectIDID of the given Object
[in]nTypeThe given object type filter
[out]aIDsThe returned vector of IDs
[in]bUpstreamSpecifies whether to return the contained objects or the parent objects
WSM_EXPORT Result WSM::APIGetObjectTextureCoordinatesReadOnly ( size_t  nHistoryID,
size_t  nObjectID,
1::vector< WSM::Point2d > &  aTexCoords 
)

Generates texture coordinates for the given ObjectHistoryID nObjectID is a face or body, other object types will return bad input error For the case of body: Generates the texture coordinates for the facets of all faces in the body This is slightly more efficient than calling per-face APIGetTextureCoordinatesReadOnly for each face of the body.

The returned vector is ordered in the following way:

  • The order of the faces is the same as in APIGetBodyFacesReadOnly.
  • For each face the order of the texture coordinates is the same as the order of the facet vertices of APIGetFaceFacetsReadOnly
  • For the faces without texture in material zero coordinates will be generated for all facet vertices of those faces. For the case of face: Generates the texture coordinates for the facets of the face. The coordinates are returned in the same order as the facet vertices of APIGetFaceFacetsReadOnly. If material for face does not have texture then zero coordinates are generated. Texture coordinates would be placed at the end of aTexCoords vector.
    Parameters
    [in]nHistoryIDID of the given History
    [in]nObjectIDID of the given object
    [out]aTexCoords
WSM_EXPORT Result WSM::APIGetObjectTypeReadOnly ( const size_t  nHistoryID,
const size_t  nObjectID,
nObjectType nType 
)

Returns Object's type in the given History.

Note, this is a read-only operation.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectIDID of the given Object
[out]nType
WSM_EXPORT Result WSM::APIGetPointMeshDataReadOnly ( size_t  nHistoryID,
size_t  nPointMeshID,
1::vector< float > &  aPoints 
)

Returns all the data from a PointMesh.

aPoints.size() is divisible by 3. Each 3-tuple of floats in aPoints is a point in the PointMesh.

Parameters
[in]nHistoryIDID of the given History
[in]nPointMeshIDID of the given PointMesh
[out]aPointsPoints
WSM_EXPORT Result WSM::APIGetPointsFromObjectIDsReadOnly ( size_t  nHistoryID,
const 1::vector< size_t > &  aIDs,
1::vector< size_t > &  aVertices,
WSM::Point3d pCOG = nullptr,
WSM::Plane pPlane = nullptr 
)

Helper function used in sweeping to get points from the profile or path Objects.

The parameter aIDs can be a a single face or multiple edges. Optionally if the pCOG or pPlane parameters are not null the function will compute the center of gravity or will return the Plane if from a Face or the calculate the plane from the edges.

Parameters
[in]nHistoryIDID of the given History
[in]aIDs
[out]aVertices
[out]pCOG
[out]pPlane
WSM_EXPORT Result WSM::APIGetRenderableFaceReadOnly ( const size_t  nHistoryID,
const size_t  nFaceID,
bool  bCalculateTexCoords,
1::vector< WSM::Point3d > &  vertices,
1::vector< WSM::UnitVector3d > &  normals,
1::vector< WSM::Point2d > &  texCoords,
bool  bBackSide = false 
)

Returns vertices in groups of 3 (triangles), with associated normals and optionally texture coordinates.

If bBackSide is true, then the data is returned for drawing the back side of the face. This means that the facet triangles are ordered in the opposite direction and the normals are reversed.

Parameters
[in]nHistoryIDID of the given History
[in]nFaceIDID of the given Face
[in]bCalculateTexCoords
[out]vertices
[out]normals
[out]texCoords
[in]bBackSideIf true, computes the back uv transform.
WSM_EXPORT Result WSM::APIGetRevitFamilyInformationReadOnly ( size_t  nHistoryID,
bool &  bIsGeneratedFromRFA,
bool &  bIsGeneratedFromBuiltinRFA,
1::string &  familyCategory,
1::string &  familyReference,
1::string &  familyType,
1::string &  familyExtraData 
)

Get Revit Family information of the specific history.

If the history was generated from Revit Family file(RFA), the API will return good and contain data in out parameters.

Parameters
[in]nHistoryIDID of the given History
[out]bIsGeneratedFromRFA
[out]bIsGeneratedFromBuiltinRFA
[out]familyCategory
[out]familyReference
[out]familyType
[out]familyExtraData
WSM_EXPORT Result WSM::APIGetSatelliteDataReadOnly ( const size_t  nHistoryID,
const size_t  nImageID,
WSM::Vector2d coordinates,
WSM::Vector2d coordinatesSpan,
1::array< size_t, 2 > &  aPixelDimensions 
)

Gets the satellite data associated with a given image.

Coordinates: (Latitude, Longitude) Coordinates Span: (Latitude Span, Longitude Span) Pixel dimensions: (Width, Height)

Parameters
[in]nHistoryIDID of the given History
[in]nImageID
[out]coordinates
[out]coordinatesSpan
[out]aPixelDimensions
WSM_EXPORT Result WSM::APIGetStringAttributeKeyValueReadOnly ( size_t  nHistoryID,
size_t  nStringAttributeID,
1::string &  sKey,
1::string &  sValue,
1::vector< size_t > &  aOwnerIDs 
)

Gets the key and value strings from a StringAttribute.

Also returns owners.

Parameters
[in]nHistoryIDID of the given History
[in]nStringAttributeIDID of the given Attribute object
[out]sKey
[out]sValue
[out]aOwnerIDs
WSM_EXPORT Result WSM::APIGetStringAttributesByKeyReadOnly ( const size_t  nHistoryID,
const size_t  nObjectID,
const 1::string &  sKey,
1::vector< size_t > &  aStringAttributeIDs 
)

Returns all StringAttributes attached to the Object given by nObjectID with key matching sKey.

Note if nObjectID is WSM::INVALID_ID, then returns all StringAttributes in the History with key sKey. This is a read-only operation.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectIDID of the given Object
[in]sKey
[out]aStringAttributeIDs
WSM_EXPORT Result WSM::APIGetTextureDataReadOnly ( size_t  nHistoryID,
size_t  nTextureID,
1::vector< char > &  aBitmapData,
bool &  bUseBitmapAlpha,
1::string *  pTextureName = nullptr 
)

Returns the data of a texture.

aBitmapData must represent a JPEG or PNG formatted image The texture name is intended as a user-provided name.

Parameters
[in]nHistoryIDID of the given History
[in]nTextureID
[out]aBitmapDataThe returned bitmap data of the texture
[out]bUseBitmapAlpha
[out]pTextureName
WSM_EXPORT Result WSM::APIGetTopLevelOwnersReadOnly ( size_t  nHistoryID,
const size_t  nObjectID,
1::vector< size_t > &  aOwnerIDs 
)

Returns the top level owners of the given Object.

For example, an Edge sharing 2 top-level Faces will return 2 top-level owners.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectIDID of the given Object
[out]aOwnerIDs
WSM_EXPORT Result WSM::APIGetVersionReadOnly ( size_t &  nMajorVer,
size_t &  nMinorVer,
size_t &  nRevisionVer 
)

Returns the Major, Minor, and Revision software versions used to identify the released version of WSM.

Parameters
[out]nMajorVerThe major software version
[out]nMinorVerThe minor software version
[out]nRevisionVerThe revision software version
WSM_EXPORT Result WSM::APIGetVertexPoint3dReadOnly ( const size_t  nHistoryID,
const size_t  nVertexID,
WSM::Point3d Pt 
)

Returns the Point3d of a Vertex.

Note this is a read-only operation.

Parameters
[in]nHistoryIDID of the given History
[in]nVertexIDID of the given Vertex
[out]Pt
WSM_EXPORT Result WSM::APIImprint ( size_t  nHistoryID,
size_t  nObject1,
size_t  nObject2,
bool  bChangeBoth = true 
)

Imprints the Objects onto each other.

Parameters
[in]nHistoryIDID of the given History
[in]nObject1ID of the first Object
[in]nObject2ID of the second Object
[in]bChangeBothIf true, the imprint is done on both Objects. If false, only nObject1 is changed.
WSM_EXPORT Result WSM::APIImprintWithPlane ( size_t  nHistoryID,
size_t  nObject,
const Plane pla 
)

Imprints the Plane onto the Object.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectID of the given Object
[in]plaThe given Plane
WSM_EXPORT Result WSM::APIIntersectsNegativeSideOfPlanesReadOnly ( const size_t  nHistoryID,
const 1::vector< WSM::Plane > &  aPlanes,
1::vector< size_t > &  aObjectIDs,
bool  bVertices = true,
bool  bEdges = true,
bool  bFaces = true,
bool  bStrict = false,
double  dTol = WSM_MACHINE_TOL,
const WSM::Line3d pLine = nullptr,
1::vector< GroupInstancePath > *  pObjectsInGroupsVec = nullptr,
1::vector< WSM::Transf3d > *  pGroupAggregateTransf3dVec = nullptr,
1::vector< 1::pair< double, ptrdiff_t > > *  pParamIndexVec = nullptr,
bool  bInstances = false,
WSM::IRayFireFilterAndAbort filterAndAbort = nullptr 
)

Get all live Objects of the types specified that intersect the negative side of all the given Planes.

This method can be used for picking. Returns the number of Objects found. If bStrict is true, only returns Objects that do not cross into the positive side of any of the Planes. Setting bStrict to true is more expensive. dTol is the tolerance used to determine how far from a Plane on the positive side can still be considered negative. Note, the positive side of a Plane is the side specified by the Plane's normal. If pObjectsInGroupsVec is given, the intersection will go into Groups and hits inside Groups will also be considered, and returned in GroupInstancePath objects. Note, no Objects that lie in Groups will be returned in aObjectIDs - these will only be in pObjectsInGroupsVec when it is supplied. If pObjectsInGroupsVec is supplied and pGroupAggregateTransf3dVec is supplied, then pGroupAggregateTransf3dVec will have the same length as pObjectsInGroupsVec and will contain the aggregate transformation on the hit Object through the chain of Instances. This is provided as a convenience since this information can also be determined from the GroupInstancePath objects. Optionally returns a sorted vector of parameter, index pairs so the ray parameter of the hit Object is known when a Line3d and pParamIndexVec is given. Note, if the index is greater than or equal to zero, the hit was direct and the ID of the Object hit is given by aObjectIDs[index]. When the index is negative, the Object hit was inside a Group and its information is found by looking at (*pObjectsInGroupsVec)[-(index + 1)]. Will only include Faces that actually intersect the line defined by pLine in the sorted output. The parameters returned can be negative.

When picking instances, pObjectsInGroupsVec and pParamIndexVec must both be nullptr. This could be relaxed in the future for strict picking, if necessary, as that already has to test every object. In that case, when the entire instance doesn't match, the components that did match could be returned.

The optional filterAndAbort interface is used to test whether a given object should be ignored (by layer visibility, or section plane clipping for example) or whether the the execution of the API should be aborted (solar analysis for example where it is enough to find at least one hit and then stop)

Parameters
[in]nHistoryIDID of the given History
[in]aPlanes
[out]aObjectIDs
[in]bVertices
[in]bEdges
[in]bFaces
[in]bStrict
[in]dTolThe maximum relative amount a Face can be moved.
[in]pLine
[out]pObjectsInGroupsVec
[out]pGroupAggregateTransf3dVec
[out]pParamIndexVec
[in]bInstances
[out]filterAndAbort
WSM_EXPORT Result WSM::APIIsEdgeManifoldReadOnly ( const size_t  nHistoryID,
const size_t  nEdgeID,
bool &  bIsManifold 
)

Returns whether an edge has exactly two coedges on two distinct faces.

Some manifold cases, such as a dangling edge inside a face, will return false.

Parameters
[in]nHistoryIDID of the given History
[in]nEdgeIDID of the given Edge
[out]bIsManifold
WSM_EXPORT Result WSM::APIIsEdgeMergeableReadOnly ( size_t  nHistoryID,
size_t  nEdgeID,
bool &  bIsMergeable,
bool  bUseMaterial = false 
)

Find out if an Edge is mergeable.

An Edge is mergeable if it has exactly two adjacent coplanar Faces. If bUseMaterial is true, an extra condition is imposed that the adjacent Faces must have the same Material for the Edge to be mergeable.

Parameters
[in]nHistoryIDID of the given History
[in]nEdgeID
[out]bIsMergeable
[in]bUseMaterial
WSM_EXPORT Result WSM::APIIsEdgeOnCircleReadOnly ( size_t  nHistoryID,
size_t  nEdgeID,
double &  radius,
WSM::Point3d center,
WSM::UnitVector3d normal,
WSM::UnitVector3d xaxis,
1::vector< size_t > &  aAllCircleSiblings,
bool &  bIsOnCircle 
)

Gets the circle data of the given Edge when the Edge lies on a circle.

The radius will be negative when the Edge is not part of a circle. Note, that the API does not generate an error if the edge does not have a circle attribute and thus can be used to test for that condition.

Parameters
[in]nHistoryIDID of the given History
[in]nEdgeID
[out]radiusThe returned radius
[out]centerThe returned center position
[out]normalThe returned normal unit vector
[out]xaxisThe returned x-axis unit vector
[out]aAllCircleSiblingsThe returned ID list of all the Edges that form the circle including the given Edge. It will be empty when the Edge is not on a circle.
[out]bIsOnCircleReturns true, when the edge is on the circle, false otherwise.
WSM_EXPORT Result WSM::APIIsEdgeOnSplineReadOnly ( size_t  nHistoryID,
size_t  nEdgeID,
1::vector< WSM::Point3d > &  aControlPoints,
bool &  bClosed,
WSM::Vector3d startTangent,
WSM::Vector3d endTangent,
1::vector< size_t > &  aAllSplineSiblings,
bool &  bIsOnSpline 
)

Gets the spline data of the given Edge when the Edge lies on a spline.

Note, that the API does not generate an error if the edge does not have a spline attribute and thus can be used to test for that condition.

Parameters
[in]nHistoryIDID of the given History
[in]nEdgeID
[out]aControlPointsThe returned vector of points on the spline. It will be empty when the given Edge is not part of a spline.
[out]bClosedReturns true if the spline end point is the same as the start point
[out]startTangentThe returned tangent vector at the spline start point
[out]endTangentThe returned tangent vector at the spline end point
[out]aAllSplineSiblingsThe returned ID list of of all the Edges that form the spline, including the given Edge. It will be empty when the given Edge is not part of a spline.
[out]bIsOnSplineReturns true, when the edge is on the spline, false otherwise.
WSM_EXPORT Result WSM::APIIsEdgeSilhouetteReadOnly ( const size_t  nHistoryID,
const size_t  nEdgeID,
const WSM::Point3d cameraPos,
const WSM::Vector3d cameraDir,
bool  bPerspectiveView,
bool &  bIsSilhouette 
)

Returns whether or not an Edge is a silhouette Edge based on the camera position, the camera direction, the view type being perspective or orthogonal.

Note an Edge with less than 2 Faces is automatically a silhouette. An Edge with more than 2 Faces is never a silhouette (although this maybe should be changed). When there are 2 Faces, the normals on the Faces dotted with cameraDir when bPerspectiveView is false or dotted with the vector from cameraPos to the start the Edge when bPersectiveView is true will have opposite signs when the Edge is a silhouette.

Parameters
[in]nHistoryIDID of the given History
[in]nEdgeIDID of the given Edge
[in]cameraPosPoint3d for the eye of the camera
[in]cameraDirVector3d for the direction of the camera
[in]bPerspectiveViewTrue if in perspective view
[out]bIsSilhouette
WSM_EXPORT Result WSM::APIIsExactMatchReadOnly ( size_t  nHistoryID1,
size_t  nHistoryID2,
bool &  bIsExact,
size_t  nObjectID1 = WSM::INVALID_ID,
size_t  nObjectID2 = WSM::INVALID_ID 
)

API compares either two Histories or two Objects and sets bIsExact to true when they match exactly.

If both nObjectID1 and nObjectId2 are WSM::INVALID_ID then the Histories are compared, otherwise the Objects are compared.

Parameters
[in]nHistoryID1
[in]nHistoryID2
[out]bIsExact
[in]nObjectID1
[in]nObjectID2
WSM_EXPORT Result WSM::APIIsFaceOnBlendReadOnly ( size_t  nHistoryID,
size_t  nFaceID,
double &  radius,
1::vector< WSM::Point3d > &  aPathPoints,
1::vector< size_t > &  aAllBlendSiblings,
bool &  bIsOnBlend 
)

Gets the blend data of the given Face when the Face lies on a blend.

The radius will be negative when the Face is not part of a blend. Note, that the API does not generate an error if the face does not have a blend attribute and thus can be used to test for that condition.

Parameters
[in]nHistoryIDID of the given History
[in]nFaceIDID of the given Face
[out]radiusThe returned radius
[out]aPathPoints
[out]aAllBlendSiblingsThe returned ID list of all the Faces that form the blend, including the given Face. It will be empty when the Face is not on a blend.
[out]bIsOnBlendReturns true, when the face is on a blend, false otherwise.
WSM_EXPORT Result WSM::APIIsFaceOnCylinderReadOnly ( size_t  nHistoryID,
size_t  nFaceID,
double &  radius,
WSM::Point3d center,
WSM::UnitVector3d normal,
WSM::UnitVector3d xaxis,
1::vector< size_t > &  aAllCylinderSiblings,
bool &  bIsOnCylinder 
)

Gets the Cylinder data of the given Face when the Face lies on a cylinder.

The radius will be negative when the Face is not part of a cylinder. Note, that the API does not generate an error if the face does not have a cylinder attribute and thus can be used to test for that condition.

Parameters
[in]nHistoryIDID of the given History
[in]nFaceIDID of the given Face
[out]radiusThe returned radius
[out]centerThe returned center position
[out]normalThe returned normal unit vector
[out]xaxisThe returned x-axis unit vector
[out]aAllCylinderSiblingsThe returned ID list of of all the Faces that form the cylinder, including the given Face. It will be empty when the Face is not on a cylinder.
[out]bIsOnCylinderReturns true, when the face is on the cylinder, false otherwise.
WSM_EXPORT Result WSM::APIIsFaceOnExtrudeReadOnly ( size_t  nHistoryID,
size_t  nFaceID,
WSM::Point3d base,
WSM::Vector3d axis,
WSM::UnitVector3d xaxis,
1::vector< WSM::Point3d > &  aControlPoints,
bool &  bClosed,
WSM::Vector3d startTangent,
WSM::Vector3d endTangent,
1::vector< size_t > &  aAllExtrudeSiblings,
bool &  bIsOnExtrude 
)

Gets the Extrude data of the given Face when the Face lies on a Extrude.

aControlPoints, bClosed, startTangent and endTangent are the parameters of the spline curve from which the surface was extruded (same as in APIIsEdgeOnSplineReadOnly()). Note, that the API does not generate an error if the face does not have an extrude attribute and thus can be used to test for that condition.

Parameters
[in]nHistoryIDID of the given History
[in]nFaceIDID of the given Face
[out]base
[out]axis
[out]xaxisThe returned x-axis unit vector
[out]aControlPointsThe returned vector of points on the spline. It may be empty if that curve info does not exist (from older WSM files).
[out]bClosedReturns true if the spline end point is the same as the start point
[out]startTangentThe returned tangent vector at the spline start point
[out]endTangentThe returned tangent vector at the spline end point
[out]aAllExtrudeSiblingsThe returned ID list of all the Faces that form the extrude, including the given Face.
[out]bIsOnExtrudeReturns true, when the face is on the extrude surface, false otherwise.
WSM_EXPORT Result WSM::APIIsFaceOnSphereReadOnly ( size_t  nHistoryID,
size_t  nFaceID,
double &  radius,
WSM::Point3d center,
WSM::UnitVector3d normal,
WSM::UnitVector3d xaxis,
1::vector< size_t > &  aAllSphereSiblings,
bool &  bIsOnSphere 
)

Gets the Sphere data of the given Face when the Face lies on a sphere.

The radius will be negative when the Face is not part of a Sphere. Note, that the API does not generate an error if the face does not have a sphere attribute and thus can be used to test for that condition.

Parameters
[in]nHistoryIDID of the given History
[in]nFaceIDID of the given Face
[out]radiusThe returned radius
[out]centerThe returned center position
[out]normalThe returned normal unit vector
[out]xaxisThe returned x-axis unit vector
[out]aAllSphereSiblingsThe returned ID list of all the Faces that form the sphere, including the given Face. It will be empty when the Face is not on a sphere.
[out]bIsOnSphereReturns true, when the face is on the sphere, false otherwise.
WSM_EXPORT Result WSM::APIIsHistoryLiveReadOnly ( size_t  nHistoryID,
bool &  bIsLive 
)

Find out if nHistoryID is live or dead.

Parameters
[in]nHistoryIDID of the given History
[out]bIsLive
WSM_EXPORT Result WSM::APIIsHistoryNonTemporaryReadOnly ( size_t  nHistoryID,
bool &  bIsNonTemporary 
)

Returns whether a history is temporary or not.

Parameters
[in]nHistoryIDID of the given History
[out]bIsNonTemporary
WSM_EXPORT Result WSM::APIIsJournalingReadOnly ( bool &  isJournaling)

Check if Journaling is enabled.

Parameters
[out]isJournaling
WSM_EXPORT Result WSM::APIIsMaterialUsedReadOnly ( const size_t  nHistoryID,
const size_t  nMaterialID,
bool &  bIsUsed 
)

Returns true if the material is used by any objects.

Parameters
[in]nHistoryIDID of the given History
[in]nMaterialID
[out]bIsUsed
WSM_EXPORT Result WSM::APIIsMeshManifoldReadOnly ( const size_t  nHistoryID,
const size_t  nMeshID,
bool &  bIsManifold 
)

Returns true when the mesh is the boundary of a solid.

Any non-manifold pieces results in the API returning false.

Parameters
[in]nHistoryIDID of the given History
[in]nMeshIDID of the given Mesh
[out]bIsManifold
WSM_EXPORT Result WSM::APIIsNonOwnedReadOnly ( const size_t  nHistoryID,
const size_t  nObjectID,
bool &  bIsNonOwned 
)

Returns whether this object has an owner.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectIDID of the given Object
[out]bIsNonOwned
WSM_EXPORT Result WSM::APIIsObjectLiveReadOnly ( size_t  nHistoryID,
size_t  nObjectID,
bool &  bIsLive 
)

Find out if nObjectID is live or dead in nHistoryID.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectIDID of the given object
[out]bIsLive
WSM_EXPORT Result WSM::APILineMeshContainsPointReadOnly ( const size_t  nHistoryID,
const size_t  nLineMeshID,
const Point3d point,
bool &  bContainsPoint 
)

Does the given LineMesh contain the given Point3d? If so, return true.

Parameters
[in]nHistoryIDID of the given History
[in]nLineMeshIDID of the given LineMesh
[in]pointThe given point
[out]bContainsPointReturns true if the given LineMesh contains the given point
WSM_EXPORT Result WSM::APILineMeshGetPointsOnNegativeSideOfPlanesReadOnly ( const size_t  nHistoryID,
const size_t  nLineMeshID,
const 1::vector< Plane > &  aPlanes,
const Line3d line,
1::vector< Point3d > &  aPoints,
double  dTol = WSM_MACHINE_TOL,
1::vector< 1::pair< Point3d, Point3d >> *  pSegments = nullptr 
)

Get all points nearest the given line from segments of the LineMesh that lie on the negative side of all the given Planes.

This method can be used for picking. dTol is the tolerance used to determine how far from a Plane on the positive side can still be considered negative. Note, the positive side of a Plane is the side specified by the Plane's normal. If pSegments is non-NULL, returns the segments that points lie on.

Parameters
[in]nHistoryIDID of the given History
[in]nLineMeshIDID of the given LineMesh
[in]aPlanesVector of planes used to test segments
[in]lineLine used to determine closest points on segments
[out]aPointsReturns points that meet the conditions
[in]dTolThe tolerance used to determine the negative side
[out]pSegmentsOptionally returns the segments that aPoints lie on.
WSM_EXPORT Result WSM::APILinkMeshesForConversion ( size_t  nHistoryID,
const 1::vector< size_t > &  aMeshIDs 
)

Link the Meshes with a shared string Attribute.

This will be used when converting from Meshes to Bodies to unite all the Bodies into one. Note this linking happens automatically when converting from a Body to Meshes so in general this API should not be called except in very rare cases.

Parameters
[in]nHistoryIDID of the given History
[in]aMeshIDsIDs of the Meshes to be linked
WSM_EXPORT Result WSM::APILoadAXMFile ( const size_t  nHistoryID,
const 1::string &  sFilePath,
const 1::vector< 1::vector< char >> *  defaultTextures = nullptr,
bool  isImport = false,
const 1::string &  logOutputPath = {} 
)

Load an AXM file, both pre WSM and current.

For pre WSM, it translates the following legacy data :

  • AModeler Solids, including transform and meta data
  • Materials
  • Textures
  • Levels
  • Project settings : convert the grid rotation to LCS If defaultTextures is non null, the 10 default textures are supplied via a vector of pixel data. For pre WSM and current : If isImport is true, the axm file is added to an existing project. This means :
  • Satellite images are skipped
  • The LCS is skipped
  • Duplicate objects that have the Object::nShareOrCopy copy behavior are avoided
  • images are sorted properly If logOutputPath is specified (non ""), a log will be written to that file which contains detailed info about the conversion. Can be used by the test harness to measure conversion success.
    Parameters
    [in]nHistoryIDID of the given History
    [in]sFilePathThe AXM file to save to.
    [in]defaultTextures
    [in]isImport
    [in]logOutputPath
WSM_EXPORT Result WSM::APILoadDeltaFromBinaryFile ( const size_t  nHistoryID,
const char *  sFilePath 
)

Load Delta from a binary file and add it to the History.

Parameters
[in]nHistoryIDID of the given History
[in]sFilePath
WSM_EXPORT Result WSM::APILoadDeltaFromBinaryString ( const size_t  nHistoryID,
const 1::string &  serializedDeltaStr,
size_t &  nDeltaID,
size_t &  nTrailingDeltaIDShift,
size_t &  nFirstDiscardedDeltaID,
bool  base64encoded = true 
)

Load Delta from the given Base64 encoded string and add it to the given History.

Parameters
[in,out]nDeltaID
  • As an input argument, if nDeltaID is not WSM::INVALID_ID:
    1. the given Delta is applied after the "previous" Delta whose ID is specified by nDeltaID. If nDeltaID matches the ID of one of the Deltas prior to the active delta, all Deltas following it may get modified (Delta IDs and IDs of the newly created Objects get incremented to avoid clashes with the Delta being added).
    2. the given Delta is loaded after the active Delta.
  • As an output argument: The value returned in nDeltaID is the ID of the newly added Delta.
[out]nTrailingDeltaIDShiftThe value returned is:
  • non-zero value, if the Delta was applied in the middle of the given History and IDs of trailing Deltas had to be incremented.
  • 0, if the Delta was applied at the end of the given History.
[out]nFirstDiscardedDeltaIDThe value returned contains the (non-incremented) ID of the first discarded Delta, which conflicted with the Delta applied mid-history.
[in]nHistoryIDID of the given History
[in]serializedDeltaStr
[in]base64encoded
WSM_EXPORT Result WSM::APILoadFromFacets ( const size_t  nHistoryID,
const 1::vector< FacetsBodyData > &  facetsData,
1::vector< size_t > &  createdObjectIDs,
const size_t  nOptions = to_ut(WSM::nLoadingOptions::RemoveDuplicate|                                                                                                                                               WSM::nLoadingOptions::Merge|                                                                                                                                               WSM::nLoadingOptions::CreateMesh),
double  dMaxDistanceFromOrigin = 0.0,
double  dRemoveDuplicateTol = WSM_MACHINE_TOL 
)

Load a model from specified list of body facets.

It is assumed that each entry in facetsData is single body createdObjectIDs returns list of Body IDs which were created. nOptions is a bit field combination of the enumerator type flags from WSM::nLoadingOptions. See WSM_Constants.h for more detail. If dMaxDistanceFromOrigin is greater than zero and the minimum corner of the bounding box around facetsData is further away than dMaxDistanceFromOrigin from the origin, then the created WSM geometry will be moved so the minimum corner of the bounding box is at the origin. dRemoveDuplicateTol is the tolerance used to find matching topology.

Parameters
[in]nHistoryIDID of the given History
[in]facetsData
[out]createdObjectIDs
[in]nOptions
[in]dMaxDistanceFromOrigin
[in]dRemoveDuplicateTol
WSM_EXPORT Result WSM::APILoadFromFile ( const size_t  nHistoryID,
const 1::string &  sFilePath,
const WSM::nFileType  eFileType = WSM::nFileTypeBinaryWSM,
ptrdiff_t *  pObjectIdOffset = nullptr,
const size_t  nOptions = to_ut(WSM::nLoadingOptions::RemoveDuplicate|                                                                                                                                               WSM::nLoadingOptions::Merge|                                                                                                                                               WSM::nLoadingOptions::CreateMesh),
double  dMaxDistanceFromOrigin = 0.0,
double  dScaleFactor = 1.0 
)

Load a model from a file of one of the supported types.

For nFileTypeBinaryWSM, *pObjectIdOffset returns object ID offset required to load the new Objects into a non-empty History without ID conflicts. nOptions contains bit flags as specified in WSM::nLoadingOptions, that describe options used by the various file types For nFileTypeSTL, if WSM::nLoadingOptions::Merge is specified under options, merges out all merge-able Edges and Vertices. if WSM::nLoadingOptions::CreateMesh is specified, creates a Mesh instead of a Body. For nFileTypeOBJ, if WSM::nLoadingOptions::Merge is specified under options, merges out all merge-able Edges and Vertices. if WSM::nLoadingOptions::RemoveDuplicate is specified under options, removes duplicated vertices and edges within each body if WSM::nLoadingOptions::PlaceOnGround is specified under options, makes the smallest z axis coordinate of the whole model to be 0 if WSM::nLoadingOptions::CreateMesh is specified, creates a Mesh instead of a Body. If dMaxDistanceFromOrigin is greater than zero and the minimum corner of the bounding box around facetsData is further away than dMaxDistanceFromOrigin from the origin, then the created WSM geometry will be moved so the minimum corner of the bounding box is at the origin. Currently this only affects OBJ. The created Object is scaled by dScaleFactor for STL and OBJ.

Parameters
[in]nHistoryIDID of the given History
[in]sFilePathThe AXM file to save to.
[in]eFileType
[out]pObjectIdOffset
[in]nOptions
[in]dMaxDistanceFromOrigin
[in]dScaleFactorThe given scale factor. Must be > 0. If <= 0, the API returns the WSM::nBadInput error result.
WSM_EXPORT Result WSM::APILoadFromString ( const size_t  nHistoryID,
const 1::string &  sInputString,
const WSM::nFileType  eFileType = WSM::nFileTypeBinaryWSM,
ptrdiff_t *  pObjectIdOffset = nullptr,
const size_t  nOptions = to_ut(WSM::nLoadingOptions::RemoveDuplicate|                                                                                                                                               WSM::nLoadingOptions::Merge|                                                                                                                                               WSM::nLoadingOptions::CreateMesh),
double  dMaxDistanceFromOrigin = 0.0,
bool  bBase64Encoded = false,
double  dScaleFactor = 1.0 
)

Load a model from a string containing serialization of one of the supported types.

For nFileTypeBinaryWSM, *pObjectIdOffset returns object ID offset required to load the new Objects into a non-empty History without ID conflicts. nOptions contains bit flags as specified in WSM::nLoadingOptions, that describe options used by the various file types (has no effect on loading the default type, nFileTypeBinaryWSM). For nFileTypeSTL, if WSM::nLoadingOptions::Merge is specified under options, merges out all merge-able Edges and Vertices. if WSM::nLoadingOptions::CreateMesh is specified, creates a Mesh instead of a Body. For nFileTypeOBJ, if WSM::nLoadingOptions::Merge is specified under options, merges out all merge-able Edges and Vertices. if WSM::nLoadingOptions::RemoveDuplicate is specified under options, removes duplicated vertices and edges within each body if WSM::nLoadingOptions::PlaceOnGround is specified under options, makes the smallest z axis coordinate of the whole model to be 0 if WSM::nLoadingOptions::CreateMesh is specified, creates a Mesh instead of a Body. If dMaxDistanceFromOrigin is greater than zero and the minimum corner of the bounding box around facetsData is further away than dMaxDistanceFromOrigin from the origin, then the created WSM geometry will be moved so the minimum corner of the bounding box is at the origin. Currently this only affects OBJ. Note that, unlike APILoadFromFile, nLoadingOptions::PlaceOnGround option is off by default. Set bBase64Encoded to true, if the string was base64 encoded when it was saved. The created Object is scaled by dScaleFactor for STL and OBJ.

Parameters
[in]nHistoryIDID of the given History
[in]sInputString
[in]eFileType
[out]pObjectIdOffset
[in]nOptions
[in]dMaxDistanceFromOrigin
[in]bBase64Encoded
[in]dScaleFactorThe given scale factor. Must be > 0. If <= 0, the API returns the WSM::nBadInput error result.
WSM_EXPORT Result WSM::APILoadHistoryFromBinaryString ( const size_t  nHistoryID,
const 1::string &  base64Str,
bool  base64encoded = true 
)

Load the whole history (with all undo states) from an, optionally base64 encoded, string and add to to an empty History.

Parameters
[in]nHistoryIDID of the given History
[in]base64Str
[in]base64encoded
WSM_EXPORT Result WSM::APILoadMaterialsFromAXMFile ( const size_t  nHistoryID,
const 1::string &  sFilePath 
)

Load only materials and their textures from an AXM file into the given history.

Materials and textures from all group histories in the file are copied into the single given history

Parameters
[in]nHistoryIDID of the given History
[in]sFilePathThe AXM file to save to.
WSM_EXPORT Result WSM::APILoft ( size_t  nHistoryID,
const 1::vector< 1::vector< size_t >> &  aaProfileIDs,
bool  bDeleteInteriorProfileFaces = false 
)

Makes Faces that connect a vector of profiles.

Each profile can be a single Face ID or a vector of Edge IDs. If bDeleteInteriorProfileFaces is true, then any interior Faces that were used as profiles will be deleted.

Parameters
[in]nHistoryIDID of the given History
[in]aaProfileIDs
[in]bDeleteInteriorProfileFaces
WSM_EXPORT Result WSM::APIMergeBody ( size_t  nHistoryID,
size_t  nBodyID,
double  dSmoothCosAngle = WSM_TIGHT_SMOOTH_COSINE_ANGLE 
)

Merges all the merge-able Edges and Vertices out of a Body.

Parameters
[in]nHistoryIDID of the given History
[in]nBodyIDID of the given Body
[in]dSmoothCosAngleCosine of the angle at which Edges should be marked smooth. If negative, disabled.
WSM_EXPORT Result WSM::APIMergeDeltas ( size_t  nHistoryID,
size_t  nStartDeltaID = WSM::INVALID_ID,
size_t  nEndDeltaID = WSM::INVALID_ID,
bool  bReuseDiscardedObjectIDs = true 
)

Merges consecutive Deltas with the specified starting and ending IDs.

If nStartDeltaID is WSM::INVALID_ID then the merge starts with the first Delta. If nEndDeltaID is WSM::INVALID_ID, then the merge stops with the active Delta. For example, in a History without redo states, if both the start and end IDs are WSM::INVALID_ID, then the History will be collapsed into a single Delta, which is similar to saving without History and restoring.

Note the merge fails if any of the IDs in the included range have been undone (and hence can be redone).

If bReuseDiscardedObjectIDs is true, all Object IDs freed during the merge will be released to be used again in subsequent operations. The default here is to reuse Object IDs, since this API is likely called either to save memory or when IDs have not yet been exposed to users. Delta IDs are never reused though.

The resulting merged Delta will have the ID of the last Delta in the range of merged Deltas.

Parameters
[in]nHistoryIDID of the given History
[in]nStartDeltaIDFirst Delta ID in the target range
[in]nEndDeltaIDLast Delta ID in the target range
[in]bReuseDiscardedObjectIDsIf true, all Object IDs freed during the operation will be released to be used again as required.
WSM_EXPORT Result WSM::APIMeshComputeNonSmoothEdgesReadOnly ( const size_t  nHistoryID,
const size_t  nMeshID,
1::vector< uint32_t > &  aEdges,
double  dCosSmoothAngle = 0.86602540378443864676372317075294 
)

Returns edges from the Mesh.

Note, the edges are only included once and are returned as subsequent pairs of indices into the m_aPoints vector. Note edges with exactly two normals are returned when the dot product of the normals is smaller than dCosSmoothAngle. So to return all edges, set dCosSmoothAngle to something larger than 1. Using 1 for dCosSmoothAngle means edges that are exactly smooth will not be returned. The default is set for 30 degrees.

Parameters
[in]nHistoryIDID of the given History
[in]nMeshIDID of the given Mesh
[out]aEdgesEdges where subsequent pairs of indices form the edge
[in]dCosSmoothAngleCosine of the angle where edges are considered smooth
WSM_EXPORT Result WSM::APIMeshComputeSilhouetteEdgesReadOnly ( const size_t  nHistoryID,
const size_t  nMeshID,
const WSM::Point3d cameraPos,
const WSM::Vector3d cameraDir,
bool  bPerspectiveView,
1::vector< uint32_t > &  aSilhouettes 
)

Returns silhouette edges from the Mesh.

Note, the edges are only included once and are returned as subsequent pairs of indices into the m_aPoints vector. Note each returned edge lies on a mesh triangle and is ordered appropriately. If there are 2 matching edges, returns the edge on the triangle whose normal is opposite lightDir.

Parameters
[in]nHistoryIDID of the given History
[in]nMeshIDID of the given Mesh
[in]cameraPosPoint3d for the eye of the camera
[in]cameraDirVector3d for the direction of the camera
[in]bPerspectiveViewTrue if in perspective view
[out]aSilhouettesSilhouettes where subsequent pairs of indices form the edge
WSM_EXPORT Result WSM::APIMeshContainsPointReadOnly ( const size_t  nHistoryID,
const size_t  nMeshID,
const Point3d point,
bool &  bContainsPoint,
WSM::UnitVector3d normal,
1::vector< WSM::Point3d > *  pTrianglePts = nullptr 
)

Does the given Mesh contain the given Point3d? If so, return true and the normal at the point.

Optionally returns the points of the triangle containing the given Point3d.

Parameters
[in]nHistoryIDID of the given History
[in]nMeshIDID of the given Mesh
[in]pointThe given point
[out]bContainsPointReturns true if the given Mesh contains the given point
[out]normalIf the Mesh contains the point, returns the normal at the point
[out]pTrianglePtsIf the Mesh contains the point and pTrianglePts is non-null, returns the points of the hit triangle.
WSM_EXPORT Result WSM::APIMeshPointOnOrInsideIfManifoldReadOnly ( const size_t  nHistoryID,
const size_t  nMeshID,
const Point3d point,
bool &  bPointOnOrInside 
)

Return true if the given point is on the Mesh.

When the point is not on the Mesh, but the Mesh is manifold, checks if the point is inside the Mesh.

Parameters
[in]nHistoryIDID of the given History
[in]nMeshIDID of the given Mesh
[in]pointThe given point
[out]bPointOnOrInsideReturns true if the given Mesh contains the given point or the point is inside the mesh when the Mesh is manifold.
WSM_EXPORT Result WSM::APIMoveImage ( const size_t  nHistoryID,
const size_t  nImageID,
const int  nShift 
)

This call alters the spatial order of images along the z (vertical) axis.

nShift can be positive or negative, moving the image up or down. It doesn't only affects the image with the given id, but all of the images involved in the movement.

Parameters
[in]nHistoryIDID of the given History
[in]nImageID
[in]nShift
WSM_EXPORT Result WSM::APIMoveObject ( size_t  nHistoryID,
const size_t  objectID,
const WSM::Vector3d displacement 
)

Move the vertices of the given object with the given displacement if it is owned; otherwise, transform the given object with the given displacement.

Parameters
[in]nHistoryIDID of the given History
[in]objectIDID of the given Object
[in]displacementThe given displacement vector
WSM_EXPORT Result WSM::APIMoveObjects ( size_t  nHistoryID,
const 1::vector< size_t > &  objectIDs,
const WSM::Transf3d t 
)

Move the vertices of each object with the given transformation if it is owned;otherwise, transform the given object.

Parameters
[in]nHistoryIDID of the given History
[in]objectIDsThe given list of Object IDs
[in]tThe given transformation
WSM_EXPORT Result WSM::APIMoveVertices ( size_t  nHistoryID,
const 1::vector< size_t > &  aVertexIDs,
const 1::vector< WSM::Point3d > &  aNewVertexPositions 
)

Move the given vertices to the new locations.

Parameters
[in]nHistoryIDID of the given History
[in]aVertexIDsThe given list of vertex IDs
[in]aNewVertexPositionsThe given list of new vertex positions
WSM_EXPORT Result WSM::APIOffset3d ( size_t  nHistoryID,
size_t  nObjectID,
double  dOffsetDistance 
)

Offsets all the Faces in the given Object by the amount specified.

If dOffsetDistance is positive, the offset is on the outside, e.g. a block would get larger. When negative, the offset is on the inside, e.g. a block would get smaller.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectIDID of the given object
[in]dOffsetDistanceThe given offset distance. If negative, the offset is applied inward instead of outward.
WSM_EXPORT Result WSM::APIOffsetEdges ( size_t  nHistoryID,
const 1::vector< size_t > &  nEdgeIDs,
double  dOffsetDistance,
const WSM::Transf3d trans = WSM::Transf3d::kIdentity,
1::vector< 1::vector< WSM::Point3d >> *  paOffsetPoint3Ds = nullptr 
)

Offsets given Edges by given distance.

Parameters
[in]nHistoryIDID of the given History
[in]nEdgeIDsID list of the given Edges
[in]dOffsetDistanceThe given offset distance. If negative, the offset is applied inward instead of outward.
[in]transIf trans is non-uniform, the offset will be first computed for the Edges with the transform applied then transformed by the inverse before returning. This allows equal distance offsets in non-uniform Instances.
[out]paOffsetPoint3DsIf provided, the operation is read-only and only the resulting offset points are returned.
WSM_EXPORT Result WSM::APIOffsetFace ( size_t  nHistoryID,
size_t  nFaceID,
double  dOffsetDistance,
bool  bOffsetHolesToo = false,
const WSM::Transf3d trans = WSM::Transf3d::kIdentity,
1::vector< 1::vector< WSM::Point3d >> *  paOffsetPoint3Ds = nullptr 
)

Offsets a Face by given distance.

Parameters
[in]nHistoryIDID of the given History
[in]nFaceIDID of the given Face
[in]dOffsetDistanceThe given offset distance. If negative, the offset is applied inward instead of outward.
[in]bOffsetHolesTooOptional. Defines whether holes should be offset too.
[in]transIf trans is non-uniform, the offset will be first computed for the Face with the transform applied then transformed by the inverse before imprinting. This allows equal distance offsets in non-uniform Instances.
[out]paOffsetPoint3DsIf provided, the operation is read-only and only the resulting offset points are returned.
WSM_EXPORT Result WSM::APIPointMeshContainsPointReadOnly ( const size_t  nHistoryID,
const size_t  nPointMeshID,
const Point3d point,
bool &  bContainsPoint 
)

Does the given PointMesh contain the given Point3d? If so, return true.

Parameters
[in]nHistoryIDID of the given History
[in]nPointMeshIDID of the given PointMesh
[in]pointThe given point
[out]bContainsPointReturns true if the given PointMesh contains the given point
WSM_EXPORT Result WSM::APIPointMeshGetPointsOnNegativeSideOfPlanesReadOnly ( const size_t  nHistoryID,
const size_t  nPointMeshID,
const 1::vector< Plane > &  aPlanes,
1::vector< Point3d > &  aPoints,
double  dTol = WSM_MACHINE_TOL 
)

Get all points of the PointMesh that lie on the negative side of all the given Planes.

This method can be used for picking. dTol is the tolerance used to determine how far from a Plane on the positive side can still be considered negative. Note, the positive side of a Plane is the side specified by the Plane's normal.

Parameters
[in]nHistoryIDID of the given History
[in]nPointMeshIDID of the given PointMesh
[in]aPlanesVector of planes used to test points
[out]aPointsReturns points that meet the conditions
[in]dTolThe tolerance used to determine the negative side
WSM_EXPORT Result WSM::APIPushBadTransformationsOntoGeometry ( size_t  nHistID,
1::function< bool(const WSM::Transf3d &) >  isTransfGood 
)

Pushes bad Instance transformations onto the underlying geometry sharing referenced Histories as much as possible.

Parameters
[in]nHistoryIDID of the given History
[in]isTransfGoodFunction that returns true if a transformation can be used.
[in]nHistID
WSM_EXPORT Result WSM::APIRayFireReadOnly ( const size_t  nHistoryID,
const WSM::Line3d ray,
1::vector< size_t > &  aObjectIDs,
double  dRayRadius = WSM_MACHINE_TOL,
bool  bVertices = true,
bool  bEdges = true,
bool  bFaces = true,
double  dMaxParam = WSM_DISTANCE_BIG,
1::vector< GroupInstancePath > *  pObjectsInGroupsVec = nullptr,
1::vector< WSM::Transf3d > *  pGroupAggregateTransf3dVec = nullptr,
1::vector< 1::pair< double, ptrdiff_t > > *  pParamIndexVec = nullptr,
WSM::IRayFireFilterAndAbort filterAndAbort = nullptr 
)

Finds all live Objects of the types specified that intersect the ray with the given ray radius.

Note, a positive ray radius value intersects using a cylinder with half-sphere end caps of the given radius. If dMaxParam is set, limits the intersection to a segment. Note, if multiple Objects are picked at the intersection, it only returns the smallest topologically. For example, if picking both Edges and Vertices and a Vertex is hit, the Edges on that Vertex are NOT returned. If pObjectsInGroupsVec is given, the ray will be fired into Groups and hits inside Groups will also be considered, and returned in GroupInstancePath objects. Note, no Objects that lie in Groups will be returned in aObjectIDs - these will only be in pObjectsInGroupsVec when it is supplied. If pObjectsInGroupsVec is supplied and pGroupAggregateTransf3dVec is supplied, then pGroupAggregateTransf3dVec will have the same length as pObjectsInGroupsVec and will contain the aggregate transformation on the hit Object through the chain of Instances. This is provided as a convenience since this information can also be determined from the GroupInstancePath objects. Optionally return a sorted vector of parameter, index pairs so the ray parameter of the hit Object is known when pParamIndexVec is given. Note, if the index is greater or equal to zero, the hit was direct and the ID of the Object hit is given by aObjectIDs[index]. When the index is negative, the Object hit was inside a Group and its information is found by looking at (*pObjectsInGroupsVec)[-(index + 1)].

The optional filterAndAbort interface is used to test whether a given object should be ignored (by layer visibility, or section plane clipping for example) or whether the the execution of the API should be aborted.

Parameters
[in]nHistoryIDID of the given History
[in]ray
[out]aObjectIDs
[in]dRayRadius
[in]bVertices
[in]bEdges
[in]bFaces
[in]dMaxParam
[out]pObjectsInGroupsVec
[out]pGroupAggregateTransf3dVec
[out]pParamIndexVec
[out]filterAndAbort
WSM_EXPORT Result WSM::APIRedoHistory ( size_t  nHistoryID,
size_t  nApplyOnDeltaID = WSM::INVALID_ID 
)

Step forward one Delta.

Parameters
[in]nHistoryIDID of the given History
[in]nApplyOnDeltaIDOptional. ID of the Delta on which to apply the operation. Defaults to the active Delta if value is WSM::INVALID_ID. If specified (which is done by the collaboration server to accept or reject this Redo), the API verifies that nApplyOnDeltaID matches the ID of the active Delta.
WSM_EXPORT Result WSM::APIRedoHistoryToDelta ( size_t  nHistory,
size_t  nDeltaID 
)

Step forward until the given Delta is reached.

Parameters
[in]nHistory
[in]nDeltaIDID of the given Delta
WSM_EXPORT Result WSM::APIRegisterLockGuardFactory ( const 1::function< AbstractLockGuard * > &  fn)

Note this is for internal use only and is not exposed to javascript.

Parameters
[in]fn
WSM_EXPORT Result WSM::APIRegisterModelChangedCallbackReadOnly ( FunctionType const &  fCallback)

Register a callback that will be called on the completion of each Delta or Undo/Redo operation within any non-temporary History, or upon the creation of a non-temporary history, or the deletion of any history.

Note this is for internal use only and is not exposed to javascript.

Parameters
[in]fCallback
WSM_EXPORT Result WSM::APIRegisterProgressCallbacksReadOnly ( WSM::ApiProgress::StartCbkFn  startCbk = WSM::ApiProgress::StartCbkFn{},
WSM::ApiProgress::ProgressCbkFn  progressCbk = WSM::ApiProgress::ProgressCbkFn{},
WSM::ApiProgress::FinishedCbkFn  finishCbk = WSM::ApiProgress::FinishedCbkFn{},
float  incrP = 1.0f,
float  startP = 0.0f,
float  endP = 100.0f 
)

Register progress callback.

Each API supporting callback notifications will call startCbk function exactly once at the beginning of this API, if the start callback function is set, then call progressCbk at least once passing endProgress, if the progress callback function is set, and finishedCbk will be called exactly once, if it is set. Passing no callbacks (or using their empty defaults) suppress the progress reporting.

Parameters
[in]startCbk
[in]progressCbk
[in]finishCbk
[in]incrP
[in]startP
[in]endP
WSM_EXPORT Result WSM::APIRemoveObjectsLayers ( size_t  nHistoryID,
1::vector< size_t > const &  aLayerIDs,
1::vector< size_t > const &  aObjectIDs 
)

Remove layers from objects.

Parameters
[in]nHistoryIDID of the given History
[in]aLayerIDs
[in]aObjectIDs
WSM_EXPORT Result WSM::APIRemoveSatelliteData ( const size_t  nHistoryID,
const size_t  nImageID 
)

Removes the satellite data associated with a given image.

Parameters
[in]nHistoryIDID of the given History
[in]nImageID
WSM_EXPORT Result WSM::APIReverseFaces ( size_t  nHistoryID,
const 1::vector< size_t > &  aFaceIDs 
)

Reverse all the Faces given by aFaceIDs.

Parameters
[in]nHistoryIDID of the given History
[in]aFaceIDsID list of the given Faces
WSM_EXPORT Result WSM::APIRotateFace ( size_t  nHistoryID,
size_t  nFaceID,
double  dRadians 
)

Rotates a Face by a given angle.

The face is rotated around its centroid, axis of rotation is face's normal Positive aRadians is counter-clockwise

Parameters
[in]nHistoryIDID of the given History
[in]nFaceIDID of the given Face
[in]dRadiansThe given angle of rotation
WSM_EXPORT Result WSM::APIRotateFaceBetweenPoints ( size_t  nHistoryID,
size_t  nFaceID,
const WSM::Point3d startPt,
const WSM::Point3d endPt 
)

Rotates a Face between two given points.

Both points are projected into the face plane. The angle of rotation is a radian from 0 to 2PI, determined by the angle counterclockwise from Vector(startPt-faceCenter) to Vector(endPt-faceCenter)

Parameters
[in]nHistoryIDID of the given History
[in]nFaceIDID of the given Face
[in]startPtUsed to determine the start vector for the angle of rotation.
[in]endPtUsed to determine the end vector for the angle of rotation.
WSM_EXPORT Result WSM::APISaveAllActiveObjectsToBinaryFileReadOnly ( const size_t  nHistoryID,
const char *  sFilePath 
)

Save all active Objects to a binary file.

Parameters
[in]nHistoryIDID of the given History
[in]sFilePath
WSM_EXPORT Result WSM::APISaveDeltaToBinaryStringReadOnly ( const size_t  nHistoryID,
1::string &  base64Str,
size_t &  deltaID,
bool  base64encode = true 
)

Serialize the given (or last, if deltaID is WSM::INVALID_ID) Delta and all its changed Objects to a binary stream, optionally Base64 encoding the serialized data, and save it to a string.

The deltaID is in/out parameter: it define the Delta to serialize, if not equal to WSM::INVALID_ID, or it receives the ID of the last delta, otherwise.

Parameters
[in]nHistoryIDID of the given History
[out]base64Str
[in,out]deltaID
  • As an input argument:
    1. If not WSM::INVALID_ID, the given Delta will be serialized.
    2. If WSM::INVALID_ID, the last Delta will be serialized.
  • As an output argument: The value returned in nDeltaID is the ID of the serialized Delta.
[in]base64encode
WSM_EXPORT Result WSM::APISaveDeltaToSolidDefReadOnly ( size_t  nHistoryID,
1::vector< 1::string > &  aChangedDeletedTop,
1::vector< 1::string > &  aChangedDeletedGeom,
1::string &  jsonStr,
bool  bForUndo = false 
)

Gets the changed, created, and deleted objects in the most recent delta and encodes this information in a solid-def JSON string so that solid-def stored in HFDM can be kept up to date.

If bForUndo is true, get the changes caused by the most recent undo, meaning that objects created in the forward action are deleted by the undo, and vice versa. If no deltas are available past the current one and bForUndo is true, the API returns the WSM::nBadInput error result.

Parameters
[in]nHistoryIDID of the given History
[out]aChangedDeletedTopGuids for changed and deleted topology objects
[out]aChangedDeletedGeomGuids for changed and deleted geometry objects
[out]jsonStrJson to make created and changed objects
[in]bForUndo
WSM_EXPORT Result WSM::APISaveHistoryToBinaryFileReadOnly ( const size_t  nHistoryID,
const char *  sFilePath,
const 1::vector< WSM::ObjectHistoryID > &  aLayerDisplayedNegateVec = {} 
)

Save the whole history (with all undo states) to a binary file.

If aLayerDisplayedNegateVec is given, the displayed flag on Layers in the vector will be negated in the save file without creating a Delta.

Parameters
[in]nHistoryIDID of the given History
[in]sFilePath
[in]aLayerDisplayedNegateVec
WSM_EXPORT Result WSM::APISaveHistoryToBinaryStringReadOnly ( const size_t  nHistoryID,
1::string &  sData,
size_t &  lastDeltaID,
bool  bBase64Encode,
const 1::vector< WSM::ObjectHistoryID > &  aLayerDisplayedNegateVec = {} 
)

Save the whole history (with all undo states) to a binary string.

If the bBase64Encode parameter is true, the data is base 64 encoded, to make it readable. Otherwise, it's just arbitrary bytes. The OUT parameter, lastDeltaID, returns the ID of the last closed Delta. If aLayerDisplayedNegateVec is given, the displayed flag on Layers in the vector will be negated in the save file without creating a Delta.

Parameters
[in]nHistoryIDID of the given History
[out]sData
[out]lastDeltaID
[in]bBase64Encode
[in]aLayerDisplayedNegateVec
WSM_EXPORT Result WSM::APISaveLastDeltaToBinaryFileReadOnly ( const size_t  nHistoryID,
const char *  sFilePath 
)

Save last Delta and all changed Objects to a binary file.

Parameters
[in]nHistoryIDID of the given History
[in]sFilePath
WSM_EXPORT Result WSM::APISaveToAXMFileReadOnly ( const size_t  nHistoryID,
const 1::vector< size_t > &  aObjectIDs,
const 1::string &  sFilePath,
1::vector< char > const &  aPreviewImage = {},
bool  bWithChildren = true 
)

Saves Objects to an AXM file.

If bWithChildren is true, all children of the given Objects are saved too. The AXM save version is fixed at version 30. Note the file only includes WSM data and the preview block. No other information is included in the file (e.g. no camera data, no material manager data, no shadow settings, etc). If a more complete AXM file is desired, save from FormIt.

Parameters
[in]nHistoryIDID of the History to save.
[in]aObjectIDsThe given list of Object IDs
[in]sFilePathThe AXM file to save to.
[in]aPreviewImageThe preview image for the file. Can be empty if there is no thumbnail otherwise should be a PNG.
[in]bWithChildrenTrue if children of Objects are also saved.
WSM_EXPORT Result WSM::APISaveToFileReadOnly ( const size_t  nHistoryID,
const 1::vector< size_t > &  aObjectIDs,
const 1::string &  sFilePath,
const WSM::nFileType  eFileType = WSM::nFileTypeBinaryWSM,
const bool  bWithChildren = true,
const double  dExportScale = 1.0,
const 1::vector< WSM::ObjectHistoryID > &  aExcludedObjects = {},
const 1::vector< WSM::ObjectHistoryID > &  aLayerDisplayedNegateVec = {} 
)

Save Objects to a file of the specified type.

If bWithChildren is true, save all children of the given Objects too. dExportScale sets the scaling transform for unit-less output formats (currently, STL and OBJ). The aExcludedObjecs vector contains objects that need to be excluded from the export. These may be instances or top level objects in referenced groups. The various exporters will check aExcludedObjects when looping through the children of the objects supplied in aObjectIDs. If aLayerDisplayedNegateVec is given, the displayed flag on Layers in the vector will be negated in the save file without creating a Delta.

Parameters
[in]nHistoryIDID of the given History
[in]aObjectIDsThe given list of Object IDs
[in]sFilePathThe AXM file to save to.
[in]eFileType
[in]bWithChildren
[in]dExportScale
[in]aExcludedObjects
[in]aLayerDisplayedNegateVec
WSM_EXPORT Result WSM::APISaveToStringReadOnly ( const size_t  nHistoryID,
const 1::vector< size_t > &  aObjectIDs,
1::string &  sOutputString,
const WSM::nFileType  eFileType = WSM::nFileTypeBinaryWSM,
const bool  bWithChildren = true,
const 1::vector< WSM::ObjectHistoryID > &  aExcludedObjects = {},
bool  bBase64Encode = false,
const 1::vector< WSM::ObjectHistoryID > &  aLayerDisplayedNegateVec = {} 
)

Save Objects to a string.

The string loses its contents, gets reset to the exact size of the output data, and gets populated by this data. If bWithChildren is true, all children of the given Objects are saved too. The aExcludedObjects vector contains objects that need to be excluded from the export. These may be instances or top level objects in referenced groups. The various exporters will check aExcludedObjects when looping through the children of the objects supplied in aObjectIDs. If the bBase64Encode parameter is true, the data is base 64 encoded, to make it readable. Otherwise, it's just arbitrary bytes. If aLayerDisplayedNegateVec is given, the displayed flag on Layers in the vector will be negated in the save string without creating a Delta.

Parameters
[in]nHistoryIDID of the given History
[in]aObjectIDsThe given list of Object IDs
[out]sOutputString
[in]eFileType
[in]bWithChildren
[in]aExcludedObjects
[in]bBase64Encode
[in]aLayerDisplayedNegateVec
WSM_EXPORT Result WSM::APIScaleFace ( size_t  nHistoryID,
size_t  nFaceID,
double  dScaleFactor 
)

Scales a Face by given scale factor, around its centroid.

Parameters
[in]nHistoryIDID of the given History
[in]nFaceIDID of the given Face
[in]dScaleFactorThe given scale factor. Must be > 0. If <= 0, the API returns the WSM::nBadInput error result.
WSM_EXPORT Result WSM::APISeparate ( size_t  nHistoryID,
size_t  nBodyID,
1::vector< size_t > &  aNewBodyIDs 
)

If the Body has more than one Lump, makes new Bodies for each Lump after the first one.

This results in all the Bodies having a single Lump. Returns a vector of new Bodies created.

Parameters
[in]nHistoryIDID of the given History
[in]nBodyIDID of the given Body
[out]aNewBodyIDs
WSM_EXPORT Result WSM::APISetAllDeltaFlags ( size_t  nHistoryID,
size_t  nOnFlags,
size_t  nOffFlags = 0,
bool  bRecursively = true 
)

Set flags of all Deltas in History nHistoryID and, optionally, recursively in all Deltas in referenced histories.

nOnFlags and nOffFlags specify the bits, which should be turned on and off. Note this is for internal use only and is not exposed to javascript.

Parameters
[in]nHistoryIDID of the given History
[in]nOnFlags
[in]nOffFlags
[in]bRecursively
WSM_EXPORT Result WSM::APISetDeltaFlags ( size_t  nHistoryID,
size_t  nDeltaID,
size_t  nDeltaFlags 
)

Set flags of Delta with ID of nDeltaID in History nHistoryID.

Note this is for internal use only and is not exposed to javascript.

Parameters
[in]nHistoryIDID of the given History
[in]nDeltaIDID of the given Delta
[in]nDeltaFlags
WSM_EXPORT Result WSM::APISetDynamoModelInformation ( size_t  nHistoryID,
const 1::string *  id = nullptr,
const 1::string *  name = nullptr,
const 1::string *  config = nullptr,
const 1::string *  delta = nullptr 
)

Set Dynamo Model information for the specific history.

Provide the parameters that will be changed

Parameters
[in]nHistoryIDID of the given History
[in]id
[in]name
[in]config
[in]delta
WSM_EXPORT Result WSM::APISetEdgesOrVerticesMarkedSmooth ( const size_t  nHistoryID,
const 1::vector< size_t > &  aObjectIDs,
bool  bSmooth 
)

Marks the smoothness of all Objects specified in aObjectIDs.

Parameters
[in]nHistoryIDID of the given History
[in]aObjectIDsThe given list of Object IDs
[in]bSmoothIf true, all are marked as smooth, otherwise all are marked as non-smooth.
WSM_EXPORT Result WSM::APISetEdgesStyle ( size_t  nHistoryID,
1::vector< size_t > const &  aObjectIDs,
const Color nColor 
)

Set the style of edges on given objects.

Parameters
[in]nHistoryIDID of the given History
[in]aObjectIDs
[in]nColor
WSM_EXPORT Result WSM::APISetFaceBacksideMaterial ( size_t  nHistoryID,
const 1::vector< size_t > &  aFaceIDs,
size_t  nMaterialID 
)

Sets the material given by MaterialID as the backside material of the given faces.

Parameters
[in]nHistoryIDID of the given History
[in]aFaceIDsID list of the given Faces
[in]nMaterialIDID of the given Material
WSM_EXPORT Result WSM::APISetFaceUVDataAttributes ( const size_t  nHistoryID,
const 1::vector< size_t > &  aFaceIDs,
const WSM::Transf3d rTransf3d = WSM::Transf3d::kIdentity,
bool  bReplaceTransform = false,
const WSM::Point3d tformCenter = nullptr,
const WSM::Point2d tformUVCenter = nullptr 
)

Sets FaceUVDataAttributes on the faces passed in and applies a transform to them.

(Note: The 3d transform should only contain 2d (x,y) transformations.)

Loops through the aFaceIDs vector, and checks if the object is of nFaceType. If the object is not nFaceType then it skips that object. If the face does not have a material with a texture then the face will be skipped as well. If it isn't skipped then two things can happen: first, if a FaceUVDataAttribute is present on the face then a new FaceUVDataAttribute is created with the affine transformation applied to the previous attribute's values and the old attribute is deleted (if the transform resolves to the identity matrix then nothing is created/deleted), or second, if no FaceUVDataAttribute exists for the face then APIGetRenderableFaceReadOnly is called to calculate texture coordinates and a new FaceUVDataAttribute is created with the affine transformation applied to the texture coordinates. If bReplaceTransform is false, the mapping from 3d to 2d is modified (e.g. rotation in the Face plane on the initial uvs) as is done for the manual texture modification. If bReplaceTransform is true, the uv transformation is taken directly from the given transformation, as in the case of using the eye dropper tool to pick a map from a Face.

Parameters
[in]nHistoryIDID of the given History
[in]aFaceIDsThe given list of Object IDs
[in]rTransf3dThe transform that will be applied to the uvs
[in]bReplaceTransformIf bReplaceTransform is true, set the transform directly
[in]tformCenterIf supplied, the transformation is executed relative to it. Otherwise the center of gravity of all the faces is used.
[in]tformUVCenterIf supplied, the 2D transformation is executed relative to it in cases where using a single linear map is not possible (e.g. when changing the texture on a collection of faces).
WSM_EXPORT Result WSM::APISetImageData ( const size_t  nHistoryID,
const size_t  nImageID,
const 1::string &  sName,
const size_t  nTextureID,
const float  fAlphaValue,
const bool  bFeaturesVisible,
const 1::array< WSM::Point3d, 4 > &  aCorners 
)

Sets the image object data.

Parameters
[in]nHistoryIDID of the given History
[in]nImageID
[in]sName
[in]nTextureID
[in]fAlphaValue
[in]bFeaturesVisible
[in]aCorners
WSM_EXPORT Result WSM::APISetLayerData ( size_t  nHistoryID,
size_t  nLayerID,
1::string const &  name,
bool  bDisplayed 
)

Set the data of a layer.

Parameters
[in]nHistoryIDID of the given History
[in]nLayerID
[in]nameName for the Object
[in]bDisplayed
WSM_EXPORT Result WSM::APISetLayersDisplayed ( size_t  nHistoryID,
1::vector< size_t > const &  aLayerIDs,
bool  bDisplayed 
)

Set the display flag of layers without affecting the other data.

Parameters
[in]nHistoryIDID of the given History
[in]aLayerIDs
[in]bDisplayed
WSM_EXPORT Result WSM::APISetLevelsData ( const size_t  nHistoryID,
const 1::vector< size_t > &  aLevelIDs,
const 1::vector< 1::pair< 1::string, double > > &  aLevelsData 
)

Sets the data in the Levels to the name, elevation pairs in aLevelData.

Note the length of aLevelData and and aLevelID must be the same.

Parameters
[in]nHistoryIDID of the given History
[in]aLevelIDs
[in]aLevelsData
WSM_EXPORT Result WSM::APISetLocalCoordinateSystem ( const size_t  nHistoryID,
const Transf3d LCS 
)

Set the LCS (local coordinate system) of the given History.

Parameters
[in]nHistoryIDID of the given History
[in]LCS
WSM_EXPORT Result WSM::APISetMaterialColor ( size_t  nHistoryID,
size_t  nMaterialID,
const Color nColor 
)

Sets a Material's color.

Parameters
[in]nHistoryIDID of the given History
[in]nMaterialIDID of the given Material
[in]nColor
WSM_EXPORT Result WSM::APISetMaterialData ( size_t  nHistoryID,
size_t  nMaterialID,
const Color nColor,
double  dHorizontalScale,
double  dVerticalScale,
size_t  nTextureID,
1::string const *  pMaterialName = nullptr,
1::string const *  pMaterialIdentifier = nullptr,
1::vector< 1::pair< 1::string, 1::string >> const *  pAdditionalRenderData = nullptr,
1::vector< 1::pair< 1::string, size_t >> const *  pAdditionalTextures = nullptr 
)

Sets all the data of a Material.

The material name is intended as a user-provided name. The material identifier is intended as a library-provided identifier. The additional data and additional texture parameters are name/value pairs of additional data from the material library. The format of this data is application defined.

Parameters
[in]nHistoryIDID of the given History
[in]nMaterialIDID of the given Material
[in]nColor
[in]dHorizontalScale
[in]dVerticalScale
[in]nTextureID
[in]pMaterialName
[in]pMaterialIdentifier
[in]pAdditionalRenderData
[in]pAdditionalTextures
WSM_EXPORT Result WSM::APISetMaterialTexture ( size_t  nHistoryID,
size_t  nMaterialID,
double  dHorizontalScale,
double  dVerticalScale,
size_t  nTextureID 
)

Sets a MaterialObject's texture data.

Parameters
[in]nHistoryIDID of the given History
[in]nMaterialIDID of the given Material
[in]dHorizontalScale
[in]dVerticalScale
[in]nTextureID
WSM_EXPORT Result WSM::APISetObjectProperties ( const size_t  nHistoryID,
const size_t  nObjectID,
const 1::string &  sObjectName,
bool  bReportAreaByLevel,
const 1::vector< size_t > *  pDefaultLevelIDs = nullptr 
)

Sets the properties of a given object (Body): A name and if that particular body reports its area by level or not, and the optional default levelIDs associated with the object.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectIDID of the given Object
[in]sObjectName
[in]bReportAreaByLevel
[in]pDefaultLevelIDs
WSM_EXPORT Result WSM::APISetObjectsLevels ( const size_t  nHistoryID,
const 1::vector< size_t > &  aObjectIDs,
const 1::vector< size_t > &  aLevelsIDs 
)

Set the levels associated with a list of objects (bodies) Empty list "clear levels from object".

Parameters
[in]nHistoryIDID of the given History
[in]aObjectIDsThe given list of Object IDs
[in]aLevelsIDs
WSM_EXPORT Result WSM::APISetObjectsMaterial ( size_t  nHistoryID,
const 1::vector< size_t > &  aObjectIDs,
size_t  nMaterialID 
)

Sets the material given by MaterialID on the given Objects.

Note only applies the Material to Faces, Objects that contain Faces (e.g Bodies), Instances, or Layers. Other Object types are ignored.

Parameters
[in]nHistoryIDID of the given History
[in]aObjectIDsThe given list of Object IDs
[in]nMaterialIDID of the given Material
WSM_EXPORT Result WSM::APISetRevitFamilyInformation ( size_t  nHistoryID,
bool  bIsGeneratedFromRFA,
bool  bIsGeneratedFromBuiltinRFA,
const 1::string &  familyCategory,
const 1::string &  familyReference,
const 1::string &  familyType,
const 1::string &  familyExtraData 
)

Set Revit Family information for the specific history.

Call this API for the history which is new created from Revit Family file.

Parameters
[in]nHistoryIDID of the given History
[in]bIsGeneratedFromRFA
[in]bIsGeneratedFromBuiltinRFA
[in]familyCategory
[in]familyReference
[in]familyType
[in]familyExtraData
WSM_EXPORT Result WSM::APISetSatelliteData ( const size_t  nHistoryID,
const size_t  nImageID,
const WSM::Vector2d coordinates,
const WSM::Vector2d coordinatesSpan,
const 1::array< size_t, 2 > &  aPixelDimensions 
)

Sets satellite data to an image object.

Coordinates: (Latitude, Longitude) Coordinates Span: (Latitude Span, Longitude Span) Pixel dimensions: (Width, Height)

Parameters
[in]nHistoryIDID of the given History
[in]nImageID
[in]coordinates
[in]coordinatesSpan
[in]aPixelDimensions
WSM_EXPORT Result WSM::APISetStringAttributeValue ( size_t  nHistoryID,
size_t  nStringAttributeID,
const 1::string &  sValue 
)

Sets the value string of a StringAttribute.

Parameters
[in]nHistoryIDID of the given History
[in]nStringAttributeIDID of the given Attribute object
[in]sValuenew string value
WSM_EXPORT Result WSM::APISetTextureData ( size_t  nHistoryID,
size_t  nTextureID,
1::vector< char > const &  aBitmapData,
bool  bUseBitmapAlpha,
1::string const *  pTextureName = nullptr 
)

Set the data of a Texture object.

aBitmapData must represent a JPEG or PNG formatted image bUseBitmapAlpha indicates whether or not the alpha channel, if any, in aBitmapData should be ignored when using it. The texture name is intended as a user-provided name.

Parameters
[in]nHistoryIDID of the given History
[in]nTextureID
[in]aBitmapDataMust represent a JPEG or PNG formatted image
[in]bUseBitmapAlphaIidicates whether the alpha channel of the texture should be used
[in]pTextureName
WSM_EXPORT Result WSM::APIShell ( size_t  nHistoryID,
size_t  nBodyID,
double  dOffsetDistance,
const 1::vector< size_t > *  paOpenFaceIDs = nullptr 
)

Shells a Body by the specified offset.

When the offset is positive the shelling is to the outside of the original Body. If negative, it is toward the inside. Any Faces in paOpenFaceIDs are not offset and hence create an opening into the otherwise closed interior Shell in the Body created by the offset.

Parameters
[in]nHistoryIDID of the given History
[in]nBodyIDID of the given Body
[in]dOffsetDistanceThe given offset distance. If negative, the offset is applied inward instead of outward.
[in]paOpenFaceIDs
WSM_EXPORT Result WSM::APISlice ( size_t  nHistoryID,
size_t  nDestinationHistoryID,
size_t  nObject,
const Plane pla,
1::vector< size_t > &  aNewNonOwnedIDs,
IsObjectHiddenFunctionType  isHiddenFunc = nullptr 
)

Slices the Object with the Plane creating new Faces and Edges that are NOT connected to the Object.

Returns these aNewNonOwnedIDs. Note, the Object to be sliced lives nHistoryID and the slice is created in nDestinationHistoryID, which can be different.

Parameters
[in]nHistoryIDID of the given History
[in]nDestinationHistoryID
[in]nObjectID of the given Object
[in]plaThe given Plane
[out]aNewNonOwnedIDs
[in]isHiddenFuncThe optional isHiddenFunc callback function is used to test whether a given object is hidden (by layer visibility for example). This api will always set the second (depth) parameter of IsObjectHiddenFunctionType to WSM_DISTANCE_BIG which meens the depth must be ignored.
WSM_EXPORT Result WSM::APISliceHistoryReadOnly ( size_t  nHistoryID,
const Plane pla,
1::vector< 1::pair< WSM::Point3d, bool >> &  aPointsToConnect,
IsObjectHiddenFunctionType  isHiddenFunc = nullptr 
)

Slices the history with the Plane creating line points.

Returns these line points in aPointsToConnect.

Parameters
[in]nHistoryIDID of the given History
[in]plaThe given Plane
[out]aPointsToConnectvector of point/smooth pairs. A segment is composed of aPointsToConnect[2*i] and aPointsToConnect[2*i+1] for each segment.
[in]isHiddenFuncThe optional isHiddenFunc callback function is used to test whether a given object is hidden (by layer visibility for example). This api will always set the second (depth) parameter of IsObjectHiddenFunctionType to WSM_DISTANCE_BIG which meens the depth must be ignored.
WSM_EXPORT Result WSM::APISplitAtNonManifoldEdgesAndVertices ( size_t  nHistoryID,
1::vector< size_t > *  paChangedHistories = nullptr 
)

Changes the model so that every edge on more than two faces and every vertex with more than one edge group is modified so that these conditions no longer occur.

Referenced Histories from Groups are always included in the correction so Deltas in multiple Histories may result from this API. If paChangedHistories is given, all Histories that have been changed will be returned. This API is used for Revit translation. Note non-owned faces with their connected component of faces are put into bodies as a side effect of this operation because overlapping non-owned faces are not expected.

Parameters
[in]nHistoryIDID of the given History
[out]paChangedHistories
WSM_EXPORT Result WSM::APISubtract ( size_t  nHistoryID,
size_t  nObject1,
size_t  nObject2,
const 1::vector< size_t > &  aExtraObjetsIDs = 1::vector< size_t >() 
)

Subtracts nObject2 and extra objects from nObject1, deleting nObject2 and extra objects.

Parameters
[in]nHistoryIDID of the given History
[in]nObject1ID of the first Object
[in]nObject2ID of the second Object
[in]aExtraObjetsIDsOptional ID list of extra objects
WSM_EXPORT Result WSM::APISubtractNonDestructive ( const GroupInstancePath blank,
const 1::vector< GroupInstancePath > &  tools 
)

Subtracts the tools from the blank changing the blank while keeping the tools unaffected.

Parameters
[in]blank
[in]tools
WSM_EXPORT Result WSM::APISweep ( size_t  nHistoryID,
const 1::vector< WSM::GroupInstancePath > &  aProfile,
const 1::vector< WSM::GroupInstancePath > &  aPath,
bool  bRemoveUnusedProfileAndPath = false 
)

Creates surface by sweeping the profile along the path.

The profile can be a single Face or a collection of Edges. Similarly the path can be a single Face or a collection of Edges. When the path is given by a Face, the outer Loop of the Face determines the path. If bRemoveUnusedProfileAndPath is true, any Objects that defined the profile and path that are unused after the sweep will be deleted.

Parameters
[in]nHistoryIDID of the given History
[in]aProfile
[in]aPath
[in]bRemoveUnusedProfileAndPath
WSM_EXPORT Result WSM::APITaperFace ( size_t  nHistoryID,
size_t  nFaceID,
double  dRadians,
const WSM::Line3d axis 
)

Taper a Face by angle of rotation around the given axis.

The angle of rotation is a radian from -PI/2 to PI/2, and is relative to the direction of the axis and the normal of the face. If the axis vector is along the positive direction of a coedge, then a positive angle will produce an outward taper and a negative angle will produce an inward taper.

Parameters
[in]nHistoryIDID of the given History
[in]nFaceIDID of the given Face
[in]dRadiansThe given angle of rotation
[in]axisThe given axis
WSM_EXPORT Result WSM::APITransformObject ( size_t  nHistoryID,
size_t  nObjectID,
const WSM::Transf3d t 
)

Transforms the given Object.

Parameters
[in]nHistoryIDID of the given History
[in]nObjectIDID of the given object
[in]tThe given transformation
WSM_EXPORT Result WSM::APITransformObjects ( size_t  nHistoryID,
const 1::vector< size_t > &  aObjectIDs,
const WSM::Transf3d t 
)

Transforms the given Objects.

Parameters
[in]nHistoryIDID of the given History
[in]aObjectIDsThe given list of Object IDs
[in]tThe given transformation
WSM_EXPORT Result WSM::APIUndoHistory ( size_t  nHistoryID,
bool  bAndDeleteRedo = false,
size_t  nApplyOnDeltaID = WSM::INVALID_ID 
)

Step backward one Delta.

Parameters
[in]nHistoryIDID of the given History
[in]bAndDeleteRedoIf true, the redo information is deleted.
[in]nApplyOnDeltaIDOptional. ID of the Delta on which to apply the operation. Defaults to the active Delta if value is WSM::INVALID_ID. If specified (which is done by the collaboration server to accept or reject this Undo), the API verifies that nApplyOnDeltaID matches the ID of the active Delta.
WSM_EXPORT Result WSM::APIUndoHistoryToDelta ( size_t  nHistoryID,
size_t  nDeltaID 
)

Step backward until the given Delta is reached.

Accepts the WSM::INVALID_ID flag to indicate the beginning of history.

Parameters
[in]nHistoryIDID of the given History
[in]nDeltaIDID of the given Delta
WSM_EXPORT Result WSM::APIUndoOrRedoHistoryToDelta ( size_t  nHistoryID,
size_t  nDeltaID,
bool  bAndDeleteRedo = false 
)

Step backward or forward until the given Delta is reached, and optionally delete redo information when undoing.

Accepts the WSM::INVALID_ID flag to indicate the beginning of history.

Parameters
[in]nHistoryIDID of the given History
[in]nDeltaIDID of the given Delta
[in]bAndDeleteRedoIf true, the redo information is deleted.
WSM_EXPORT Result WSM::APIUnite ( size_t  nHistoryID,
size_t  nObject1,
size_t  nObject2,
const 1::vector< size_t > &  aExtraObjetsIDs = 1::vector< size_t >() 
)

Unites the Objects, deleting nObject2 and extra objects.

Parameters
[in]nHistoryIDID of the given History
[in]nObject1ID of the first Object
[in]nObject2ID of the second Object
[in]aExtraObjetsIDsOptional ID list of extra objects
WSM_EXPORT Result WSM::APIUniteNonDestructive ( const GroupInstancePath blank,
const 1::vector< GroupInstancePath > &  tools 
)

Unites the tools with the blank changing the blank while keeping the tools unaffected.

Parameters
[in]blank
[in]tools
WSM_EXPORT void WSM::AppendToGroupInstancePathArray ( WSM::GroupInstancePath const &  path,
1::vector< size_t > const &  aInput,
1::vector< WSM::GroupInstancePath > &  aOutput 
)

Takes a WSM::GroupInstancePath and a vector of objects ID values in the same history, and populates the GroupInstancePath vector with that data.

Parameters
[in]pathThe given editing context path
[in]aInput
[out]aOutput
WSM_EXPORT void WSM::AppendToGroupInstancePathArray ( size_t  nHistoryID,
1::vector< size_t > const &  aInput,
1::vector< WSM::GroupInstancePath > &  aOutput 
)

Takes a history ID and a vector of objects ID values, and adds to the GroupInstancePath vector with that data.

WSM_EXPORT void WSM::AppendToGroupInstancePathArray ( size_t  nHistoryID,
1::vector< WSM::ObjectHistoryID > const &  aInput,
1::vector< WSM::GroupInstancePath > &  aOutput 
)

Takes a history ID and a vector of objects ID values, and adds to the GroupInstancePath vector with that data.

WSM_EXPORT bool WSM::BoxIntersectsNegativeSideOfPlanes ( const Interval3d box,
const 1::vector< Plane > &  aPlanes,
double  dTol = WSM_MACHINE_TOL 
)

Returns true if the box intersects the negative side of all the Planes.

Parameters
[in]box
[in]aPlanesVector of planes used to test segments
[in]dTolThe maximum relative amount a Face can be moved.
WSM_EXPORT bool WSM::BoxLiesOnNegativeSideOfPlanes ( const Interval3d box,
const 1::vector< Plane > &  aPlanes,
double  dTol = WSM_MACHINE_TOL 
)

Returns true if the box lies totally on the negative side of all the Planes.

Parameters
[in]box
[in]aPlanesVector of planes used to test segments
[in]dTolThe maximum relative amount a Face can be moved.
double WSM::ComputeDeterminant ( const WSM::Point3d a,
const WSM::Point3d b,
const WSM::Point3d c 
)
inline

ComputeDeterminant function.

Parameters
[in]a
[in]b
[in]c
WSM_EXPORT void WSM::ComputeFaceXAndYVectors ( const WSM::UnitVector3d norm,
WSM::Vector3d faceX,
WSM::Vector3d faceY 
)

Compute the faceX and faceY vectors to generate texture coordinates based a plane normal.

Parameters
[in]normThe normal of a given face.
[out]faceXComputed X axis in the face.
[out]faceYComputed Y axis in the face.
bool WSM::doIntersect ( const WSM::Point2d p1,
const WSM::Point2d p2,
const WSM::Point2d q1,
const WSM::Point2d q2,
double  tolerance = WSM_DISTANCE_TOL 
)

Retuns true if the two line segments (p1,p2) and (q1,q2) intersect or overlap, false otherwise.

It handles special cases.

Parameters
[in]p1
[in]p2
[in]q1
[in]q2
[in]tolerance
constexpr bool WSM::enable_bitmask_operators ( nLoadingOptions  )

enable_bitmask_operators function.

WSM::Point2d WSM::intersect ( const WSM::Point2d p1,
const WSM::Vector2d v1,
const WSM::Point2d p2,
const WSM::Vector2d v2,
bool &  succeeded,
double  tolerance = WSM_DISTANCE_TOL 
)

intersection of two 2d lines (p1,v1) and (p2,v2)

Parameters
[in]p1
[in]v1
[in]p2
[in]v2
[out]succeeded
[in]tolerance
bool WSM::operator&& ( const Point2d  p,
const Interval2d interv 
)
inline

Returns true iff the given interval contains the given point.

bool WSM::operator&& ( const Point3d p,
const Interval3d interv 
)
inline

Returns true iff the given interval contains the given point.

bool WSM::overlap ( const Interval3d i1,
const Interval3d i2 
)
inline

Returns true iff the two given intervals overlap.

Parameters
[in]i1
[in]i2
bool WSM::point_inside ( Interval3d const &  i,
Point3d const &  p 
)
inline

Returns true iff the given point lies inside the given interval.

Parameters
[in]i
[in]p
WSM_EXPORT bool WSM::PointIntersectsNegativeSideOfPlanes ( const Point3d pt,
const 1::vector< Plane > &  aPlanes,
double  dTol = WSM_MACHINE_TOL 
)

Returns true if the point intersects the negative side of all the Planes.

Parameters
[in]pt
[in]aPlanesVector of planes used to test segments
[in]dTolThe maximum relative amount a Face can be moved.
WSM_EXPORT WSM::Point2d WSM::projectPointOnLine ( const WSM::Point2d p,
const WSM::Point2d lpoint,
const WSM::Vector2d lvector 
)

Project point p on line (lpoint, lvector)

Parameters
[in]p
[in]lpoint
[in]lvector
WSM_EXPORT bool WSM::SegmentIntersectsNegativeSideOfPlanes ( const Point3d pt1,
const Point3d pt2,
const 1::vector< Plane > &  aPlanes,
double  dTol = WSM_MACHINE_TOL,
bool  bTestEndPts = true 
)

Returns true if the segment from pt1 to pt2 intersects on the negative side of all the Planes.

If bTestEndPts is true, considers end points of the segment, which is sometimes not necessary if they are considered in a separate step.

Parameters
[in]pt1
[in]pt2
[in]aPlanesVector of planes used to test segments
[in]dTolThe maximum relative amount a Face can be moved.
[in]bTestEndPts

Variable Documentation

const size_t WSM::ATTRIBUTE_FILE_VERSION = 2

The version where Attributes where added.

const size_t WSM::AXM_FIRST_FORWARD_COMPATIBILITY_VERSION = 0

AXM forward compatibility file version If you make a change to the AXM file structure that makes it impossible for older applications to read this new file, you need to increase AXM_FORWARD_COMPATIBILITY_VERSION.

However, this should only be done if there is no other way to keep the file forward compatible, or we decide for other reasons to force users to use the newest app to read these files. History of AXM forward compatibility file versions Original compatibility version

const size_t WSM::AXM_FORWARD_COMPATIBILITY_VERSION = 0

Latest compatibility version This needs to be the same as the last version above.

const size_t WSM::AXM_MAJOR_FILE_VERSION = 32

The current major file version for the AXM format This needs to be the same as the last AXM file version above.

const size_t WSM::AXM_VERSION_FOR_WSM22 = 28

AXM version update to reflect WSM version 22.

const size_t WSM::AXM_VERSION_FOR_WSM23 = 30

AXM version update to reflect WSM version 23.

const size_t WSM::AXM_VERSION_LAYER_PICKABLE = 31

AXM version where a pickable flag was added to formit layers.

Layer block version was incremented as well

const size_t WSM::AXM_VERSION_TRANSPARENT_GROUND = 32

AXM version where ground transparency was added.

Renderer settings block version was incremented as well

const size_t WSM::AXM_VERSION_WITH_AMBIENT_CONTRAST = 29

AXM version that contains the ambient contrast rendering setting.

const size_t WSM::AXM_VERSION_WITH_BRIGHTNESS_SETTINGS = 26

First AXM version with brightness/shader settings.

const size_t WSM::AXM_VERSION_WITH_ENV_SETTINGS = 27

First AXM version with env settings.

const size_t WSM::AXM_VERSION_WITH_FORWARD_COMPATIBILITY = 20

Increase the file version to keep track of changes to the format, which remain forward compatible (i.e.

this file can be read by older apps without causing problems in that app). If the format becomes unreadable by older apps, the compatibility version also needs to increase. See below. History of AXM file versions First AXM version with forward compatibility field

const size_t WSM::AXM_VERSION_WITH_MATERIAL_MANAGER = 22

First AXM version with material manager.

const size_t WSM::AXM_VERSION_WITH_MATERIAL_PREVIEW = 24

First AXM version with material preview images.

const size_t WSM::AXM_VERSION_WITH_SECTIONPLANE_RENDER_OPTS = 25

First AXM version with section plane rendering options.

const size_t WSM::AXM_VERSION_WITH_UNDO_MANAGER = 21

First AXM version with undo manager.

const size_t WSM::AXM_VERSION_WSM_LAYER_DISPLAY = 23

First AXM version where the Layer display information in the WSM block is set to match the Layer block.

const size_t WSM::BLENDATTRIBUTE_VERSION = 16

The version where BlendAttributes were added.

const size_t WSM::CORRECTBODYBOX_FILE_VERSION = 3

Body box cannot be trusted in previous versions.

const size_t WSM::DELTAFLAGS_FILE_VERSION = 9

The version where Delta flags were added.

const size_t WSM::EDGESTYLE_FILE_VERSION = 12

The version where EdgeStyleAttribute was added.

const size_t WSM::FACEUVDATA_FILE_VERSION = 12

The version where FaceUVDataAttribute was added.

const size_t WSM::FIXEDLEVELANDLAYERATTR_VERSION = 15

The version where files no longer contain level attributes, whose level owner does not contain the attribute.

Same for Layers.

const size_t WSM::GENERATEDGEOMETRYINFORMATION_VERSION = 17

The version where GeneratedGeometryInformation were added.

const size_t WSM::GROUP_FILE_VERSION = 8

The version where Groups were added.

const size_t WSM::HEADERSIZE_FILE_VERSION = 9

The version where binary header size was added.

const size_t WSM::INVALID_ID = (1::numeric_limits<size_t>::max)()
const size_t WSM::INVALID_IDx32 = 0xFFFFFFFF
const size_t WSM::INVALID_SIZE = (1::numeric_limits<size_t>::max)()
const size_t WSM::LAYER_FILE_VERSION = 10

The version where Layer and LayerAttribute were added.

const size_t WSM::LINE_AND_POINT_MESH = 21

The version where Line and Point Meshes were added.

const size_t WSM::MATERIAL_ATTR_BACK_FACE_VERSION = 14

The version where MaterialAttribute added a back face flag.

const size_t WSM::MATERIAL_DATA_VERSION = 12

The version where Material and Texture names and Protein material values were added.

const size_t WSM::MESH_COLOR_VERSION = 20

The version where Mesh vertex colors were added.

const size_t WSM::MESH_HIDDEN_EDGES_VERSION = 22

The version where Mesh hidden lines were added.

const size_t WSM::MESH_VERSION = 19

The version where Mesh object was added.

const size_t WSM::PREVDELTAID0_FILE_VERSION = 7

The version where prevDeltaID of the 1st Delta in History is 0 and not -1.

const size_t WSM::REVITFAMILYINFORMATION_FILE_VERSION = 11

The version where RevitFamilyInformation were added.

const size_t WSM::SHARED_BITMAPS = 23

The version where bitmap sharing for Textures across Histories was added.

const size_t WSM::SKETCHPROPERTIES_LCS_VERSION = 13

The version where SketchProperties changed from using a double for grid rotation to a Transf3d for the local coordinate system.

const size_t WSM::SOFTWAREVERSIONx100 = 23

"7" means "Version 0.07" This needs to be the same as the last version above

const size_t WSM::STRINGATTRIBUTE_VERSION = 18

The version where string Attributes were added.

const size_t WSM::TEXTURE_FILE_VERSION = 4

The version where textures were added.

const size_t WSM::TEXTURE_PNG_FILE_VERSION = 5

The version where textures are blessed to be in PNG format.

const size_t WSM::UNUSED_INDEX = size_t(-1)

Used in texture, material or layer indices to indicate an unused value.

const size_t WSM::XAXIS_FILE_VERSION = 6

The version where the X axis was added to the geometry attributes.