49 using namespace HDK_Sample;
52 PRM_Name(
"usedisk",
"Use Disk Image"),
111 state = (USEDISK()) ? 0 : 1;
129 UT_String relpath, fullpath, netpath, nodepath;
132 me->COPPATH(relpath, 0.0F);
138 for (i = 0; i < items.
entries() && i < theMaxSize; i++)
153 OP_Node *node_ptr, *parent_ptr;
202 node = ((
OP_Network *)node)->getRenderNodePtr();
208 node = (
OP_Node *) CAST_COP2NODE(node);
225 SOP_CopRaster::updateRaster(
fpreal t)
239 if (myCurrentName == fname)
245 if (!myRaster.
load(fname))
252 myCurrentName.
harden(fname);
330 int rstate = updateRaster(t);
344 int xres = myRaster.
Xres();
345 int yres = myRaster.
Yres();
348 bool sameres = samenum && (myPrevXRes == xres) && (myPrevYRes == yres);
371 if (!colorh.isValid())
381 for (
int x = 0;
x < xres; ++
x)
383 for (
int y = 0;
y < yres; ++
y, ++rgba, ++ptoff)
388 gdp->
setPos3(ptoff, (
float)
x/(
float)xres, (
float)
y/(
float)yres, 0);
391 colorh.set(ptoff, clr);
virtual TIL_Raster * getNodeRaster(const char *fullpath, const char *cmenu, const char *amenu, bool override_frame=false, fpreal frame=1.0, TIL_DataFormat f=TILE_MAX_DATA_FORMAT)
void setRasterDepth(UT_RasterDepth depth)
SYS_FORCE_INLINE void bumpDataId()
static PRM_Template myTemplateList[]
virtual bool updateParmsFlags()
PRM_API const PRM_Type PRM_PICFILE
static void buildColorMenu(const char *net, const char *node, UT_ValArray< char * > &items)
PRM_API const PRM_Type PRM_STRING
const OP_NodeFlags & flags() const
OP_Node * findNode(const char *path, OTLSyncMode syncmode=OTLSYNC_DOSYNC) const
Uses the path (eg. "/obj/geo1") to find a node in our hierarchy.
void clearAndDestroy()
Clear all the points/primitives out of this detail.
GLsizei const GLchar *const * path
void setToken(const char *s)
Sets the token, doing a deep copy.
void getRelativePath(const char *src_fullpath, const char *dest_fullpath, bool file_path=false)
const GA_Attribute * findDiffuseAttribute(GA_AttributeOwner who) const
GA_Attribute * getP()
Convenience method to access the P attribute.
GA_Attribute * addDiffuseAttribute(GA_AttributeOwner who, GA_Storage s=GA_STORE_INVALID)
#define OP_FLAG_GENERATOR
void addCommonError(UT_CommonErrorCode what, const char *msg=0)
bool addOperator(OP_Operator *op, std::ostream *err=nullptr)
static void buildColorMenu(void *data, PRM_Name *, int, const PRM_SpareData *, const PRM_Parm *)
This static methods is used to build a menu for the UI.
OP_Network * getCreator() const
static TIL_CopResolver * getResolver()
GA_RWHandleT< UT_Vector3F > GA_RWHandleV3
static PRM_SpareData cop2Path
bool updateParmsFlags() override
void splitCOP2Path(const char *path, UT_String &net, UT_String &node)
Splits a full cop2 path into the net and node portions.
const char * getFullPath(UT_String &str) const
OP_ERROR cookMySop(OP_Context &context) override
void newSopOperator(OP_OperatorTable *table)
SYS_FORCE_INLINE GA_Offset appendPointBlock(GA_Size npoints)
Append new points, returning the first offset of the contiguous block.
bool enableParm(int pi, int state, int v=-1)
void size(short w, short h, void *newRaster=0)
SOP_CopRaster(OP_Network *, const char *, OP_Operator *)
void harden()
Take shallow copy and make it deep.
GLuint const GLchar * name
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
PRM_API const PRM_Type PRM_FLT_J
GLenum GLenum GLsizei void * table
void setManagesDataIDs(bool onOff)
virtual OP_OpTypeId getOpTypeID() const
static int getNodeId(const char *net, const char *node)
static OP_Node * myConstructor(OP_Network *, const char *, OP_Operator *)
exint entries() const
Alias of size(). size() is preferred.
PRM_API PRM_Default PRMoneDefaults[]
SYS_FORCE_INLINE void setPos3(GA_Offset ptoff, const UT_Vector3 &pos)
Set P from a UT_Vector3.
virtual void addExtraInput(OP_Node *op, OP_InterestType type)
void setTimeDep(bool on_off)
int load(const char *pathname, IMG_ScaleOp scaled=IMG_SCALE_NONE, UT_FilterType filter=UT_FILTER_POINT, short size=100, bool watermarked=false, bool topremult=true)
PRM_API const PRM_Type PRM_TOGGLE
static OP_Node * lookupNode(int unique_id, bool include_proxy=false)
UT_RGBA * getRaster() const
void select(GU_SelectionType stype)
#define TIL_DEFAULT_COLOR_PLANE
SYS_FORCE_INLINE GA_Offset pointOffset(GA_Index index) const
Given a point's index (in append order), return its data offset.
int getFullCOP2Path(const char *relpath, UT_String &fullpath, int &flagdependent)
~SOP_CopRaster() override
void setLabel(const char *s)
Sets the label, doing a deep copy.
SYS_FORCE_INLINE GA_Size getNumPoints() const
Return the number of points.
static PRM_SpareData fileChooserModeRead