xsi_geometry.h
Go to the documentation of this file.

    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 ICEAttribute;
    00038
    00039 namespace MATH {
    00040 class CTransformation;
    00041 };
    00042
    00043 //*****************************************************************************
    00068 //*****************************************************************************
    00069
    00070 class SICPPSDKDECL Geometry : public SIObject
    00071 {
    00072 public:
    00074     Geometry();
    00075
    00077     ~Geometry();
    00078
    00082     Geometry(const CRef& in_ref);
    00083
    00087     Geometry(const Geometry& in_obj);
    00088
    00093     bool IsA( siClassID in_ClassID) const;
    00094
    00098     siClassID GetClassID() const;
    00099
    00105     Geometry& operator=(const Geometry& in_obj);
    00106
    00112     Geometry& operator=(const CRef& in_ref);
    00113
    00118     CFacetRefArray      GetFacets() const;
    00119
    00124     CSegmentRefArray    GetSegments() const;
    00125
    00130     CPointRefArray      GetPoints() const;
    00131
    00136     CSampleRefArray     GetSamples() const;
    00137
    00142     CRefArray           GetClusters() const;
    00143
    00148     CTriangleRefArray   GetTriangles() const;
    00149
    00161     CStatus AddCluster( const CString& in_type,
    00162                         const CString& in_name,
    00163                         const CLongArray& in_indices,
    00164                         Cluster& io_cluster);
    00165
    00174     CStatus AddEmptyCluster(
    00175                         const CString& in_type,
    00176                         const CString& in_name,
    00177                         Cluster& io_cluster);
    00178
    00243     PointLocatorData GetSurfacePointLocatorsFromPoints
    00244     (
    00245         LONG in_nbPoints = -1,
    00246         const LONG* in_pPoints = NULL
    00247     ) const;
    00248
    00360     PointLocatorData GetClosestLocations
    00361     (
    00362         LONG            in_nbPositions,
    00363         const double*   in_pPositions
    00364     ) const;
    00365
    00449     PointLocatorData GetRaycastIntersections
    00450     (
    00451         LONG                    in_nbPositions,
    00452         const double*           in_pPositions,
    00453         const double*           in_pRays,
    00454         siLineIntersectionType  in_eLineType = siSemiLineIntersection
    00455     ) const;
    00456
    00488     PointLocatorData GetClosestLocationsWithinRadius
    00489     (
    00490         const MATH::CVector3&       in_position,
    00491         double              in_radius,
    00492         LONG                in_nbToSearch = -1
    00493     ) const;
    00494
    00561     CStatus SetupPointLocatorQueries
    00562     (
    00563         siClosestLocationMethod in_method,
    00564         MATH::CTransformation* in_pTransfo,
    00565         LONG in_nbFacetsToRestrictSearch,
    00566         const LONG* in_pFacetsToRestrictSearch,
    00567         LONG in_nbLocatorsToBeQueried
    00568     );
    00569
    00582     CStatus SetupClosestLocationQueries
    00583     (
    00584         siClosestLocationMethod in_method = siClosestSurface,
    00585         MATH::CTransformation* in_pTransfo = NULL,
    00586         LONG in_nbFacetsToRestrictSearch = -1,
    00587         const LONG* in_pFacetsToRestrictSearch = NULL
    00588     )
    00589     {
    00590         return SetupPointLocatorQueries( in_method, in_pTransfo, in_nbFacetsToRestrictSearch, in_pFacetsToRestrictSearch, -1 );
    00591     }
    00592
    00609     CStatus EvaluatePositions
    00610     (
    00611         const PointLocatorData& in_ptLocators,
    00612         LONG in_nbPointLocatorsIndices, //-1 if all
    00613         const LONG* in_pPointLocatorsIndices, // 0 if all
    00614         double* out_pPositions
    00615     ) const;
    00616
    00634     CStatus EvaluateNormals
    00635     (
    00636         const PointLocatorData& in_ptLocators,
    00637         siNormalComputationMethod in_ComputationMethod,
    00638         LONG in_nbPointLocatorsIndices, //-1 if all
    00639         const LONG* in_pPointLocatorsIndices, // 0 if all
    00640         double* out_pNormals
    00641     ) const;
    00642
    00675     CStatus EvaluateClusterProperty
    00676     (
    00677         const PointLocatorData& in_ptLocators,
    00678         LONG in_nbPointLocatorsIndices, //-1 if all
    00679         const LONG* in_pPointLocatorsIndices, // 0 if all
    00680         const Cluster& in_parentCluster,
    00681         const ClusterProperty& in_clusterProperty,
    00682         float* out_pData
    00683     ) const;
    00684
    00995     CStatus PutCache
    00996     (
    00997         CValue & in_Cache
    00998     );
    00999
    01014     CValue GetCache();
    01015
    01030     CStatus GetBoundingBox
    01031     (
    01032        double                & out_centerx,
    01033        double                & out_centery,
    01034        double                & out_centerz,
    01035        double                & out_extentx,
    01036        double                & out_extenty,
    01037        double                & out_extentz,
    01038        const MATH::CTransformation & in_XfoObjectToBBoxSpace
    01039     ) const;
    01040
    01041
    01055     CStatus GetBoundingSphere
    01056     (
    01057        double                      & out_centerx,
    01058        double                      & out_centery,
    01059        double                      & out_centerz,
    01060        double                      & out_radius,
    01061        siVolumeCenterMethod          in_centerMethod,
    01062        const MATH::CTransformation & in_XfoObjectToBSphereSpace
    01063     );
    01064
    01080     CStatus GetBoundingCapsule
    01081     (
    01082         double                        & out_centerx,
    01083         double                        & out_centery,
    01084         double                        & out_centerz,
    01085         double                        & out_length,
    01086         double                        & out_radius,
    01087         siVolumeCenterMethod            in_centerMethod,
    01088         siBoundingCapsuleMethod         in_axisMethod,
    01089         const MATH::CTransformation   & in_XfoObjectToBCapsuleSpace
    01090     ) ;
    01091
    01097     CRefArray GetICEAttributes() const;
    01098
    01161     ICEAttribute GetICEAttributeFromName( const CString& in_name ) const;
    01162
    01174     ICEAttribute AddICEAttribute( const CString& in_name, XSI::siICENodeDataType in_DataType, XSI::siICENodeStructureType in_StructureType, XSI::siICENodeContextType in_ContextType );
    01175
    01185     CStatus RemoveICEAttribute( const CString& in_name );
    01186
    01187     private:
    01188     Geometry * operator&() const;
    01189     Geometry * operator&();
    01190 };
    01191
    01192 };
    01193
    01194 #endif // __XSIGEOMETRY_H__