00001
00011
00012
00013 #if (_MSC_VER > 1000) || defined(SGI_COMPILER)
00014 #pragma once
00015 #endif
00016
00017 #ifndef __XSIGEOMETRY_H__
00018 #define __XSIGEOMETRY_H__
00019
00020 #include <xsi_siobject.h>
00021 #include <xsi_math.h>
00022 #include <xsi_longarray.h>
00023 #include <xsi_doublearray.h>
00024 #include <xsi_cluster.h>
00025 #include <xsi_clusterproperty.h>
00026 #include <xsi_pointlocatordata.h>
00027 #include <xsi_vector3.h>
00028
00029 namespace XSI {
00030
00031 class CFacetRefArray;
00032 class CSegmentRefArray;
00033 class CPointRefArray;
00034 class CSampleRefArray;
00035 class CRefArray;
00036 class CTriangleRefArray;
00037 class MATH::CTransformation;
00038 class ICEAttribute;
00039
00040
00065
00066
00067 class SICPPSDKDECL Geometry : public SIObject
00068 {
00069 public:
00071 Geometry();
00072
00074 ~Geometry();
00075
00079 Geometry(const CRef& in_ref);
00080
00084 Geometry(const Geometry& in_obj);
00085
00090 bool IsA( siClassID in_ClassID) const;
00091
00095 siClassID GetClassID() const;
00096
00102 Geometry& operator=(const Geometry& in_obj);
00103
00109 Geometry& operator=(const CRef& in_ref);
00110
00115 CFacetRefArray GetFacets() const;
00116
00121 CSegmentRefArray GetSegments() const;
00122
00127 CPointRefArray GetPoints() const;
00128
00133 CSampleRefArray GetSamples() const;
00134
00139 CRefArray GetClusters() const;
00140
00145 CTriangleRefArray GetTriangles() const;
00146
00158 CStatus AddCluster( const CString& in_type,
00159 const CString& in_name,
00160 const CLongArray& in_indices,
00161 Cluster& io_cluster);
00162
00171 CStatus AddEmptyCluster(
00172 const CString& in_type,
00173 const CString& in_name,
00174 Cluster& io_cluster);
00175
00240 PointLocatorData GetSurfacePointLocatorsFromPoints
00241 (
00242 LONG in_nbPoints = -1,
00243 const LONG* in_pPoints = NULL
00244 ) const;
00245
00357 PointLocatorData GetClosestLocations
00358 (
00359 LONG in_nbPositions,
00360 const double* in_pPositions
00361 ) const;
00362
00446 PointLocatorData GetRaycastIntersections
00447 (
00448 LONG in_nbPositions,
00449 const double* in_pPositions,
00450 const double* in_pRays,
00451 siLineIntersectionType in_eLineType = siSemiLineIntersection
00452 ) const;
00453
00485 PointLocatorData GetClosestLocationsWithinRadius
00486 (
00487 const MATH::CVector3& in_position,
00488 double in_radius,
00489 LONG in_nbToSearch = -1
00490 ) const;
00491
00558 CStatus SetupPointLocatorQueries
00559 (
00560 siClosestLocationMethod in_method,
00561 MATH::CTransformation* in_pTransfo,
00562 LONG in_nbFacetsToRestrictSearch,
00563 const LONG* in_pFacetsToRestrictSearch,
00564 LONG in_nbLocatorsToBeQueried
00565 );
00566
00579 CStatus SetupClosestLocationQueries
00580 (
00581 siClosestLocationMethod in_method = siClosestSurface,
00582 MATH::CTransformation* in_pTransfo = NULL,
00583 LONG in_nbFacetsToRestrictSearch = -1,
00584 const LONG* in_pFacetsToRestrictSearch = NULL
00585 )
00586 {
00587 return SetupPointLocatorQueries( in_method, in_pTransfo, in_nbFacetsToRestrictSearch, in_pFacetsToRestrictSearch, -1 );
00588 }
00589
00606 CStatus EvaluatePositions
00607 (
00608 const PointLocatorData& in_ptLocators,
00609 LONG in_nbPointLocatorsIndices,
00610 const LONG* in_pPointLocatorsIndices,
00611 double* out_pPositions
00612 ) const;
00613
00631 CStatus EvaluateNormals
00632 (
00633 const PointLocatorData& in_ptLocators,
00634 siNormalComputationMethod in_ComputationMethod,
00635 LONG in_nbPointLocatorsIndices,
00636 const LONG* in_pPointLocatorsIndices,
00637 double* out_pNormals
00638 ) const;
00639
00672 CStatus EvaluateClusterProperty
00673 (
00674 const PointLocatorData& in_ptLocators,
00675 LONG in_nbPointLocatorsIndices,
00676 const LONG* in_pPointLocatorsIndices,
00677 const Cluster& in_parentCluster,
00678 const ClusterProperty& in_clusterProperty,
00679 float* out_pData
00680 ) const;
00681
00992 CStatus PutCache
00993 (
00994 CValue & in_Cache
00995 );
00996
01011 CValue GetCache();
01012
01027 CStatus GetBoundingBox
01028 (
01029 double & out_centerx,
01030 double & out_centery,
01031 double & out_centerz,
01032 double & out_extentx,
01033 double & out_extenty,
01034 double & out_extentz,
01035 const MATH::CTransformation & in_XfoObjectToBBoxSpace
01036 ) const;
01037
01038
01052 CStatus GetBoundingSphere
01053 (
01054 double & out_centerx,
01055 double & out_centery,
01056 double & out_centerz,
01057 double & out_radius,
01058 siVolumeCenterMethod in_centerMethod,
01059 const MATH::CTransformation & in_XfoObjectToBSphereSpace
01060 );
01061
01077 CStatus GetBoundingCapsule
01078 (
01079 double & out_centerx,
01080 double & out_centery,
01081 double & out_centerz,
01082 double & out_length,
01083 double & out_radius,
01084 siVolumeCenterMethod in_centerMethod,
01085 siBoundingCapsuleMethod in_axisMethod,
01086 const MATH::CTransformation & in_XfoObjectToBCapsuleSpace
01087 ) ;
01088
01094 CRefArray GetICEAttributes() const;
01095
01158 ICEAttribute GetICEAttributeFromName( const CString& in_name ) const;
01159
01160 private:
01161 Geometry * operator&() const;
01162 Geometry * operator&();
01163 };
01164
01165 };
01166
01167 #endif // __XSIGEOMETRY_H__