21 #ifndef __RAY_Procedural__
22 #define __RAY_Procedural__
39 class ray_ProcInstance;
45 class RAY_ProceduralData;
143 const char *
getName()
const {
return myName; }
145 const char *
getType()
const {
return myType; }
189 {
return get() == g.
get(); }
191 {
return get() != g.
get(); }
198 const GU_Detail *
get(
int segment=0)
const;
205 bool isValid()
const;
212 fpreal velocityBounds()
const;
215 int motionSegments()
const;
238 const fpreal *shutter_times,
298 void setShutterOpen(
fpreal shutter);
331 const char *
name=
"P");
342 int acceleration_segments = 1,
358 int argc,
const char *
const*argv);
362 int argc,
const int *argv);
364 int argc,
const fpreal *argv);
373 const fpreal *shutter_times,
441 bool isValid()
const;
474 void limitAutoProcedural(AutoProceduralType aproc);
482 bool addProcedural(
int argc,
char *argv[],
531 bool changeSetting(
const char *
name,
const char *
value,
532 const char *style =
"object");
533 bool changeSetting(
const char *
name,
int argc,
534 const char *
const*argv,
535 const char *style =
"object");
536 bool changeSetting(
const char *
name,
int argc,
538 const char *style =
"object");
539 bool changeSetting(
const char *
name,
int argc,
const int *argv,
540 const char *style =
"object");
541 bool changeSetting(
const char *
name,
int argc,
const fpreal *argv,
542 const char *style =
"object");
555 bool declareSetting(
const char *
name,
const char *
value);
556 bool declareSetting(
const char *
name,
int argc,
557 const char *
const*argv);
558 bool declareSetting(
const char *
name,
int argc,
const int *argv);
559 bool declareSetting(
const char *
name,
int argc,
const fpreal *argv);
563 void debugSettings(
const char *style=
"object")
const;
571 void declarePrimitiveAttributeSettings(
585 const UT_StringHolder &property_map=UT_StringHolder());
599 void processPrimitiveMaterial(
617 ray_ProcInstance *
handle() {
return myHandle; }
622 ray_ProcInstance *myHandle;
640 virtual const char *className()
const = 0;
669 virtual void render() = 0;
692 int lookupParmToken(
const char *
name)
const;
700 const int64 *getIParm(
int token,
size_t &
size)
const;
701 const fpreal64 *getFParm(
int token,
size_t &
size)
const;
706 auto &&
id = lookupParmToken(name);
707 return id >= 0 ? getIParm(
id, size) :
nullptr;
711 auto &&
id = lookupParmToken(name);
712 return id >= 0 ? getFParm(
id, size) :
nullptr;
716 auto &&
id = lookupParmToken(name);
717 return id >= 0 ? getSParm(
id, size) :
nullptr;
730 bool import(
const char *
name,
int32 *
value,
int vectorsize)
const;
731 bool import(
const char *
name,
int64 *
value,
int vectorsize)
const;
735 bool import(const
char *name,
UT_StringHolder &result,
int idx=0) const;
745 bool import(
RAY_Handle handle, const
char *name,
746 int64 *value,
int vectorsize) const;
747 bool import(
RAY_Handle handle, const
char *name,
748 fpreal32 *value,
int vectorsize) const;
749 bool import(
RAY_Handle handle, const
char *name,
750 fpreal64 *value,
int vectorsize) const;
753 bool import(
RAY_Handle handle, const
char *name,
761 bool local_only = false) const;
788 static void optimizeGeometry(
GU_Detail &gdp,
789 bool create_normals_if_needed);
791 bool create_normals_if_needed);
804 const fpreal *shutter_times=
nullptr
808 const fpreal *shutter_times=
nullptr
817 const RAY_ProceduralData *
data()
const {
return myData; }
818 RAY_ProceduralData *
data() {
return myData; }
992 const
char *style = "
object")
994 if (!checkChild(
"changeSetting"))
996 return myChild->changeSetting(name, value, style);
999 const
char *const*argv,
1000 const
char *style = "
object")
1002 if (!checkChild(
"changeSetting"))
1004 return myChild->changeSetting(name, argc, argv, style);
1007 const
char *style = "
object")
1009 if (!checkChild(
"changeSetting"))
1011 return myChild->changeSetting(name, argc, argv, style);
1014 const
char *style = "
object")
1016 if (!checkChild(
"changeSetting"))
1018 return myChild->changeSetting(name, argc, argv, style);
1035 if (!checkChild(
"declareSetting"))
1037 return myChild->declareSetting(name, value);
1040 const
char *const*argv)
1042 if (!checkChild(
"declareSetting"))
1044 return myChild->declareSetting(name, argc, argv);
1048 if (!checkChild(
"declareSetting"))
1050 return myChild->declareSetting(name, argc, argv);
1054 if (!checkChild(
"declareSetting"))
1056 return myChild->declareSetting(name, argc, argv);
1071 const
char *property_map=
nullptr);
1074 void debugSettings(const
char *style="
object") const;
1078 static
void lookupPrimitiveMaterialAttributes(
1097 SYS_DEPRECATED(16.0)
void setDisplacement(const
char *shader, fpreal=0);
1110 bool parseMaterialIFD(const
char *
filename);
1114 int queryWorldTransformSamples() const;
1117 UT_Matrix4D queryWorldTransform(
int sample) const;
1171 const
char *queryName(
RAY_Handle handle) const;
1174 const
char *queryObjectName(
RAY_Handle handle) const;
1177 const
char *queryRootName() const;
1198 if (!
import(handle,
"object:surface", tmp, 0))
1207 if (!
import(h,
"object:displace", tmp, 0))
1215 if (!
import(handle,
"object:displacebound",
1224 if (!
import(handle,
"object:phantom", &phantom, 1))
1232 if (!
import(handle,
"object:reflectbounce", &bounce, 1))
1240 if (!
import(handle,
"object:refractbounce", &bounce, 1))
1249 if (!
import(handle,
"object:reflectmask", tmp, 0))
1258 if (!
import(handle,
"object:refractmask", tmp, 0))
1266 const fpreal *shutter_times,
1267 bool writeable)
const;
1269 template <
typename T>
1271 T &value,
int vectorsize)
const;
1273 bool checkChild(
const char *method)
const;
1277 RAY_ProceduralData *myData;
GA_ROHandleS myMaterialOverride
RAY_ProceduralData * data()
const char * getValue() const
Return the default value.
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
bool operator==(const RAY_ROProceduralGeo &g) const
Definition of a geometry attribute.
GU_ConstDetailHandle handle(int segment=0) const
Access the GU_ConstDetailHandle for a given segment.
const GU_Detail * operator->() const
GT_API const UT_StringHolder filename
#define SYS_DEPRECATED(__V__)
void * RAY_LightHandle
A handle for lights. Can also be used anywhere a RAY_Handle is expected.
virtual bool isEqual(const RAY_Procedural *) const
SYS_VISIBILITY_EXPORT RAY_Procedural * allocProcedural(const char *name)
Mantra procedural primitives.
#define SYS_VISIBILITY_EXPORT
Class representing a child object of the current procedural.
SYS_FORCE_INLINE void clear()
GLsizei const GLfloat * value
const RAY_Procedural * parent() const
Return parent procedural.
SYS_FORCE_INLINE T * SYSconst_cast(const T *foo)
Reference counted geometry handle for procedurals.
Base class for volume primitives in mantra.
RAY_ProceduralGeo & operator=(const RAY_ProceduralGeo &src)
virtual bool canGenerateInstancedGeometry() const
Procedural primitive for mantra (RAY)
RAY_ProceduralArg(const char *name=0, const char *type=0, const char *value=0)
**But if you need a result
const char * getType() const
Return the storage type of the argument.
bool operator!=(const RAY_ROProceduralGeo &g) const
GLdouble GLdouble GLdouble q
GU_Detail & operator*() const
A reference counter base class for use with UT_IntrusivePtr.
const UT_StringHolder * getSParm(const char *name, size_t &size) const
const GU_Detail & operator*() const
GA_ROHandleS myCategories
IFDmantra you can see code vm_image_mplay_direction endcode When SOHO starts a render
const char * getName() const
Return the name of the argument.
#define SYS_DEPRECATED_REPLACE(__V__, __R__)
void * RAY_ObjectHandle
A handle for objects. Can also be used anywhere a RAY_Handle is expected.
GA_API const UT_StringHolder material_override
void * RAY_Handle
Aliases for different handle types.
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
GA_ROHandleS myLightCategories
SYS_FORCE_INLINE const UT_StringHolder & UTmakeUnsafeRef(const UT_StringRef &ref)
Convert a UT_StringRef into a UT_StringHolder that is a shallow reference.
const fpreal64 * getFParm(const char *name, size_t &size) const
GA_ROHandleS myShopMaterialPath
GLuint const GLchar * name
OPENVDB_API void initialize()
Global registration of native Grid, Transform, Metadata and Point attribute types. Also initializes blosc (if enabled).
const int64 * getIParm(const char *name, size_t &size) const
RAY_ProceduralChildPtr createChild() const
GA_API const UT_StringHolder transform
RAY_ProceduralGeo(const RAY_ProceduralGeo &src)
Copy c-tor.
Parameter definition for arguments to RAY_Procedural.
GLfloat GLfloat GLfloat GLfloat h
A map of string to various well defined value types.
GA_ROHandleS myPropertyOverride
RAY_ROProceduralGeo & operator=(const RAY_ROProceduralGeo &src)
LeafData & operator=(const LeafData &)=delete
GU_Detail * operator->() const
SYS_VISIBILITY_EXPORT void registerProcedural(RAY_ProceduralFactory *factory)
Modern interface to register procedurals.
UT_IntrusivePtr< RAY_ProceduralChild > RAY_ProceduralChildPtr
SYS_VISIBILITY_EXPORT const RAY_ProceduralArg * getProceduralArgs(const char *n)
Dynamic load entry point to query arguments for a procedural.
const GU_Detail * get(int segment=0) const
UT_SharedPtr< Data > myData
GA_API const UT_StringHolder shop_materialpath
RAY_ProceduralGeo()
Default constructor.
void * RAY_MaterialHandle
A handle for materials. Can also be used anywhere a RAY_Handle is expected.