HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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  ~SIM_RayIntersect() override;
37 
38  /// Clears the ray intersection data.
39  void initializeSubclass() override;
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  int64 getMemorySizeSubclass() const override;
43  bool getIsAlternateRepresentationSubclass() const override;
45  const SIM_Data &) override;
46 
47 private:
48  /// Build the ray intersection structure from some geometry.
49  void createRayIntersect(const SIM_Geometry *geo);
50 
51  mutable GU_RayIntersect myRayIntersect;
52 
55  SIM_Data,
56  "Geometry Ray Intersector",
58 };
59 
60 #endif
61 
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:50
virtual bool getIsAlternateRepresentationSubclass() const
virtual int64 getMemorySizeSubclass() const
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:63
long long int64
Definition: SYS_Types.h:116
#define SIM_API
Definition: SIM_API.h:12
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()