HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SIM_RayIntersect.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  */
7 
8 #ifndef __SIM_RayIntersect_h__
9 #define __SIM_RayIntersect_h__
10 
11 #include "SIM_API.h"
12 #include <GU/GU_RayIntersect.h>
13 #include "SIM_DataUtils.h"
14 
15 class SIM_Geometry;
16 
17 /// This class hold a GU_RayIntersect structure. This is a data structure
18 /// that can be built from any GU_Detail. As such, this data should be
19 /// used by attaching it as subdata to a SIM_Geometry, and calling
20 /// createRayIntersect(). Because this data can be recreated on demand,
21 /// it returns true from the getIsAlternateRepresentationSubclass() function
22 /// and is never saved to or loaded from disk. It also gets deleted
23 /// automatically if the parent SIM_Geomtry data changes.
25 {
26 public:
27  /// Get the ray intersection structure. Note that the ray intersect
28  /// information is always stored for the geometry without applying the
29  /// geometry transform. This is unlike the SIM_SDF class, but is
30  /// required by the nature of the ray intersection data structure,
31  /// which holdson to primitive pointers.
32  GU_RayIntersect &getRayIntersect() const;
33 
34 protected:
35  explicit SIM_RayIntersect(const SIM_DataFactory *factory);
36  virtual ~SIM_RayIntersect();
37 
38  /// Clears the ray intersection data.
39  virtual void initializeSubclass();
40  /// Returns the information that this data type is built on demand.
41  /// It can be rebuilt at any time from any SIM_Geometry data.
42  virtual int64 getMemorySizeSubclass() const;
43  virtual bool getIsAlternateRepresentationSubclass() const;
44  virtual void initAlternateRepresentationSubclass(const SIM_Data &);
45 
46 private:
47  /// Build the ray intersection structure from some geometry.
48  void createRayIntersect(const SIM_Geometry *geo);
49 
50  mutable GU_RayIntersect myRayIntersect;
51 
54  SIM_Data,
55  "Geometry Ray Intersector",
57 };
58 
59 #endif
60 
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:45
virtual bool getIsAlternateRepresentationSubclass() const
virtual int64 getMemorySizeSubclass() const
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:58
long long int64
Definition: SYS_Types.h:100
#define SIM_API
Definition: SIM_API.h:10
virtual void initAlternateRepresentationSubclass(const SIM_Data &)
static const SIM_DopDescription * getEmptyDopDescription()
A DOP description that says not to create an automatic DOP.
virtual void initializeSubclass()