DD::Image::GeoOp Class Reference

Inherits DD::Image::Op, and DD::Image::GeneralInfoProvider.

Inherited by DD::Image::ModifyGeo, DD::Image::NullGeo, DD::Image::ParticleRender, DD::Image::TransformGeo, and DD::Image::WriteGeo.

Public Member Functions

virtual ~GeoOp ()
 
Scenescene () const
 
void build_scene (Scene &scene)
 
void get_geometry (Scene &, GeometryList &out)
 
void setupScene ()
 
bool evaluate_transform (int obj, GeometryList &out, bool transform_normals=true)
 
int minimum_inputs () const override
 
int maximum_inputs () const override
 
Opdefault_input (int input) const override
 
bool test_input (int input, Op *op) const override
 
GeoOpinput (int n) const
 
GeoOpinput0 () const
 
GeoOpinput1 () const
 
const char * node_shape () const override
 
unsigned node_color () const override
 
void knobs (Knob_Callback) override
 
void shadow_knobs (Knob_Callback f)
 
void knobs (Knob_Callback, bool sourcegeo, bool geoselectSaves=false)
 
int knob_changed (Knob *k) override
 
virtual void print_info (std::ostream &o)
 
unsigned objects () const
 
unsigned vertices (int obj) const
 
std::vector< GeoInfo::Cache > & getCacheList ()
 
HandlesMode doAnyHandles (ViewerContext *) override
 
void build_matrix_handles (ViewerContext *ctx, const Matrix4 *localMatrix=nullptr)
 
void build_handles (ViewerContext *ctx) override
 
virtual void select_geometry (ViewerContext *, GeometryList &scene_objects)
 
void assign_drawlists (int obj, GeoInfo &info)
 
Display3DMode display3d () const
 
RenderMode render_mode () const
 
bool selectable () const
 
virtual bool selection3DChanged (ViewerContext *ctx)
 
virtual bool selection3DCleared ()
 
virtual bool selection3DMouseDown (ViewerContext *ctx)
 
virtual bool selection3DMouseUp (ViewerContext *ctx)
 
virtual bool selection3DMouseDrag (ViewerContext *ctx)
 
const Hashhash (int i) const
 
const GeometryMaskrebuild_mask () const
 
bool rebuild (const GeometryMask &m=GeometryMask(Mask_All_Geometry)) const
 
void set_rebuild (const GeometryMask &m)
 
void clear_rebuild (const GeometryMask &m)
 
const GeneralInfogeneralInfo () const override
 
GeoOpgeoOp () override
 Cast to a GeoOp. This is much cheaper and safer than using dynamic_cast.
 
const GeoOpgeoOp () const override
 
OpHints opHints () const override
 Return hints to control when and how this op will be evaluated by the top-down system.
 
- Public Member Functions inherited from DD::Image::Op
PrevalidateResult preValidate (ViewerContext *ctx=nullptr, PreValidateContext *=nullptr)
 
OprootOp () const
 
bool preValidateAborted (int treeStartingVersion, PrevalidateResult &result) const
 
const OutputSetgetOutputs () const
 return all the outputs of this node
 
virtual void setInputsValid (bool nowValid)
 set whether the input ops are valid (are for the right context)
 
bool inputsValid () const
 return whether the input ops are valid (are for the right context)
 
virtual bool can_clone () const
 returns whether or not an op can be cloned in the dag
 
bool haveHash () const
 return true if the hash() value is meaningful and globally unique
 
virtual std::vector< DD::Image::OutputContextgetPrevVersionsWanted () const
 
virtual const MetaData::Bundle_fetchMetaData (const char *keyname)
 
const MetaData::BundlefetchMetaData (const char *keyname)
 
Node * node () const
 
DD::Image::NodeI * getNode () const
 
void node (Node *v)
 
OpfirstOp () const
 
void firstOp (Op *v)
 
Opparent () const
 
void parent (Op *lpOp)
 
virtual void detach ()
 node has been deleted in DAG
 
virtual void attach ()
 node has been created in DAG
 
virtual void pre_write_knobs ()
 
int replace_knobs (Knob *afterthis, int n, void(*f)(void *, Knob_Callback), void *, const char *fileExt=nullptr)
 
int add_knobs (void(*f)(void *, Knob_Callback), void *, Knob_Callback)
 
void set_unlicensed ()
 
Knobknob (const char *name) const
 
Knobknob (int) const
 
bool pushed () const
 
bool panel_visible () const
 
bool node_disabled () const
 
bool node_selected () const
 
unsigned node_gl_color () const
 
void * field (const char *name)
 
void * field (const char *name, int &type)
 
void * set_field (const char *name, const void *source, int size)
 
void * get_field (const char *name, void *dest, int size)
 
void beginHandle (HandleType command, ViewerContext *ctx, EventCallback *cb, int index, float x=0, float y=0, float z=0, ViewerContext::Cursor cursor=ViewerContext::kNoCursor)
 
void endHandle (ViewerContext *ctx)
 
virtual int knob_change_finished (Knob *knob, bool changedByUser=true)
 
void addTime (OpTimer::Category category, long long microsecondsCPU, long long microsecondsWall, bool isTopLevel=true)
 
void getPerformanceInfo (OpTimer::Category category, OpTimer::PerformanceInfo &info) const
 return the amount of CPU time taken by this op
 
virtual bool inputs_clockwise () const
 whether unconnected inputs on the DAG should be arranged clockwise or anticlockwise (default)
 
virtual std::vector< int > input_order () const
 
virtual int inputArrows (int nodeInputs) const
 
bool script_command (const char *command, bool py=true, bool eval=true) const
 
bool script_expand (const char *str) const
 
HandlesMode anyHandles (ViewerContext *ctx)
 
void add_draw_handle (ViewerContext *)
 
virtual void draw_handle (ViewerContext *)
 
virtual void add_input_handle (int input, ViewerContext *)
 
void add_op_handle (ViewerContext *ctx)
 
void add_knob_handle (Knob *, ViewerContext *)
 
virtual int getViewableModes () const
 
virtual int optional_input () const
 
int inputs () const
 
int node_inputs () const
 
Opnode_input (int, GenerateType=OUTPUT_OP) const
 
Opnode_input (int, GenerateType, const DD::Image::OutputContext *outputContext) const
 
Opinput_op (int n=0) const
 
virtual void inputs (int n)
 
Opinput (int) const
 
int inputNumber (int input, int offset) const
 
Opinput (int input, int offset) const
 
Opinput0 () const
 return the primary input More...
 
Opinput1 () const
 return the second input, if it exists More...
 
const std::vector< Op * > & getInputs () const
 
const std::vector< Op * > & getChildren () const
 
virtual void set_input (int i, Op *op, int input, int offset)
 
void set_input0 (Op *op)
 
void set_input (int i, Op *op)
 
void set_input (int i, Op &op)
 
void set_input (int input, int offset, Op *op)
 
const OutputContextoutputContext () const
 
virtual void setOutputContext (const OutputContext &c)
 
virtual void append (Hash &)
 
virtual float uses_input (int) const
 
virtual void build_splits ()
 
virtual int split_input (int) const
 
virtual const OutputContextinputContext (int n, int offset, OutputContext &) const
 
virtual const OutputContextinputUIContext (int n, OutputContext &) const
 
const Hashhash () const
 
virtual bool frameTransformImplemented () const
 
virtual bool frameTransformDownstream (const OutputContext &context, unsigned int input, float inFrame, float &outFrame) const
 
virtual bool frameTransformUpstream (const OutputContext &context, unsigned int input, float outFrame, float &inFrame) const
 
virtual DopeItemFlags::Mask getDopeItemFlags () const
 
virtual bool shouldHideInDopeSheet (Knob *knob) const
 
virtual DD::Image::KnobgetDopeItemKnob () const
 
virtual ViewSet viewsProduced () const
 
virtual ViewSet viewsWantOn (int i) const
 
virtual ViewSet splitForViews () const
 
bool requested () const
 
void setRequested ()
 
void forgetRequestShallow ()
 
void forget_request ()
 
void forget_request (std::set< Op * > &forgotten)
 
DD::Image::Hash curveHash () const
 
bool opCurrent () const
 
virtual const char * node_help () const =0
 
virtual const char * input_label (int, char *) const
 
virtual std::string input_longlabel (int) const
 
void node_redraw ()
 
void print_name (std::ostream &o) const
 
NodeContext nodeContext () const
 
std::string node_name () const
 
void invalidateSameHash ()
 
bool invalidate ()
 
bool invalidate (const Hash &hash)
 
bool update (const Box *=nullptr)
 
void asapUpdate ()
 
void asapUpdate (const Box &box, int direction=0)
 
void validate (bool for_real=true)
 
virtual void force_validate (bool for_real=true)
 
void update_handles () const
 
bool valid () const
 Returns true if it has been validated - including if there was an error. More...
 
bool real_valid () const
 Returns true if it has been real-validated - including if there was an error. More...
 
bool inErrorState () const
 
bool inInvalidState () const
 
bool opened () const
 
void open ()
 
void unopen ()
 
bool running () const
 
void running (bool v)
 
bool not_closed () const
 
void close ()
 
void callCloseAfter (double seconds)
 
void copyState (Op *input)
 
bool cached () const
 
void cached (bool b)
 
virtual bool inUse () const
 
virtual Executableexecutable ()
 
void setKnobsToContext (const OutputContext &)
 
void gotoContext (const OutputContext &, bool update)
 
void progressFraction (double fraction, StatusFlags flags=StatusNone)
 
void progressFraction (int a, int b, StatusFlags flags=StatusNone)
 
void progressMessage (const char *fmt,...)
 
void progressModalMessage (const char *fmt,...)
 
void progressDismiss ()
 
int slowness () const
 
void slowness (int newval)
 
virtual bool firstEngineRendersWholeRequest () const
 
virtual bool updateUI (const OutputContext &context)
 
const Formatinput_format () const
 
const OutputContextuiContext () const
 
void error (const char *fmt,...)
 
void warning (const char *fmt,...)
 
void critical (const char *fmt,...)
 
void debug (const char *fmt,...)
 
void abort () const
 Abort all trees the op is in.
 
bool aborted () const
 True if one of the trees the op is in was aborted; ops should check this while processing and return quickly when true.
 
void cancel () const
 Cancel all trees the op is in. Make sure you also call abort() to stop processing.
 
bool cancelled () const
 True if one of the trees the op is in was cancelled (by user interaction)
 
bool addToTree (OpTree *lpTree)
 Returns true if the op was added to the tree, or false if its reference count increased.
 
bool removeFromTree (OpTree *lpTree)
 Returns false if the op was removed from the tree, or true if its reference count decreased.
 
bool isInTree (OpTree *lpTree) const
 Checks if an op is in a particular tree, for debugging purposes.
 
bool isInAnyTree () const
 Checks if an op is in any tree at all.
 
OpTreeHandlergetTreeHandler () const
 Returns the treeHandler for a given Op.
 
bool hasError () const
 
bool opOrChildHasError () const
 
const OpgetErroredOp () const
 
void setPopUpScheme (PopUpScheme lScheme)
 
PopUpScheme getPopUpScheme () const
 
bool arePopUpsEnabled ()
 Returns whether a pop-up should be enabled for the next message, modifying internal data when necessary.
 
OpMessageHandlergetMsgHandler ()
 
const OpMessageHandlergetMsgHandler () const
 
std::string getDebugInfo () const
 Returns a string of debug information about the op. For internal use.
 
std::string getDetailedDebugInfo () const
 
bool tryValidate (bool for_real=true)
 
virtual Iopiop ()
 Cast to an Iop. This is much cheaper and safer than using dynamic_cast.
 
virtual const Iopiop () const
 
virtual ParticleOpparticleOp ()
 Cast to a ParticleOp. This is much cheaper and safer than using dynamic_cast.
 
virtual const ParticleOpparticleOp () const
 
virtual DeepOnlyOpdeepOnlyOp ()
 Cast to a DeepOnlyOp. This is much cheaper and safer than using dynamic_cast.
 
virtual const DeepOnlyOpdeepOnlyOp () const
 
virtual std::string getLibraryName () const
 Return a label and version string to display library version info for the Node.
 
virtual VersionInfo getLibraryVersion () const
 
virtual const char * Class () const =0
 
const std::string libraryDisplayName () const
 
virtual const char * displayName () const
 
virtual std::string docsPath () const
 
virtual bool onAction (const ViewerContext *c, const DD::Image::Flags f, void *d)
 
Opget (const Description *description)
 

Static Public Member Functions

static void transform_points (PointList *out, const PointList *in, const Matrix4 &)
 
static void transform_points (PointList *out, const PointList *in, int start, int end, const Matrix4 &)
 
static void clear_drawlist_trashbin ()
 
- Static Public Member Functions inherited from DD::Image::Op
static int treeVersion ()
 get the current tree version
 
static bool nukeBusy ()
 is nuke processing something on a parallel thread?
 
static Opcreate (Node *node, const char *name, Op *p_op)
 
static Opcreate (const char *name, Op *p_op)
 
static void resetTimers ()
 reset all the performance timers
 
static void setTimingEnabled (bool enabled)
 turn performance timing on or off
 
static bool isTimingEnabled ()
 return whether performance timing is on or not
 
static const char * script_result (bool py=false)
 
static void script_unlock ()
 
static void all_forget_request ()
 
static void new_request_pass ()
 
static double callPendingClose (double seconds)
 
static void clearPendingClose ()
 
static Operror_op ()
 
static const char * error_message ()
 
static void clearAbortAndError ()
 To be removed.
 
static void SetDefaultPopUpEnable (bool lEnable)
 This is used by Nuke to indicate when ops using the default pop-up scheme should show pop-ups. Not recommended for customisation.
 
static std::string getVersionInfoStr (const VersionInfo &versionInfo)
 
static const Descriptionfind_description (const char *name, const Op *op_)
 
static int message_f (char t, const char *,...)
 
static int message_vf (char t, const char *, va_list)
 
static void add_timeout (float t, TimeoutHandler, void *v=nullptr)
 
static void repeat_timeout (float t, TimeoutHandler, void *=nullptr)
 
static bool has_timeout (TimeoutHandler, void *=nullptr)
 
static void remove_timeout (TimeoutHandler, void *=nullptr)
 

Protected Member Functions

 GeoOp (Node *)
 Base class constructor. More...
 
void _validate (bool for_real) override
 
virtual void updateGeneralInfo ()
 
void display3d (Display3DMode v)
 
void selectable (bool v)
 
void render_mode (RenderMode v)
 
void backface_culling (int v)
 
void update_geometry_hashes ()
 
virtual void get_geometry_hash ()
 
void delete_cache ()
 
void synchronize_cache (GeometryList &out)
 
void delete_allocations (GeoInfo::Cache &cache)
 
virtual void geometry_engine (Scene &, GeometryList &out)
 
void add_draw_geometry (ViewerContext *)
 
- Protected Member Functions inherited from DD::Image::Op
 Op (Node *node)
 The constructor is protected so only subclasses can create the base class.
 
virtual void _invalidate ()
 
virtual void _open ()
 
virtual void _close ()
 
Opcreate (Node *node, const char *name)
 
Opcreate (const char *name)
 
HandlesMode anyInputHandles (ViewerContext *)
 return if any of the inputs (recursively) wish to draw handles More...
 
HandlesMode anyKnobHandles (ViewerContext *)
 return if any of the knobs on this node wish to draw handles More...
 
void build_input_handles (ViewerContext *)
 
void build_knob_handles (ViewerContext *)
 
void disallowNoTrees ()
 Call this to tell the op that it should always have op trees for normal behaviour (for internal use)
 
virtual PrevalidateResult doPreValidate (ViewerContext *ctx=nullptr, PreValidateContext *=nullptr)
 

Protected Attributes

Hash geo_hash [Group_Last]
 
Scenescene_
 Points to scene if it is turned on.
 
GeneralInfo info_
 
std::vector< GeoInfo::Cachecache_list
 Geometry cache structures.
 
Hash cache_hash [Group_Last]
 Cache out-of-dateness hashes.
 
GeometryMask rebuild_mask_
 What groups need updating.
 
bool cache_resursive
 
Hash cache_build_hash
 
int display3d_
 GUI display setting.
 
bool selectable_
 GUI selectable checkmark.
 
int render_mode_
 Render setting.
 
int backface_culling_
 Backface cull setting.
 
bool cast_shadow_
 
bool receive_shadow_
 
- Protected Attributes inherited from DD::Image::Op
bool _haveHash
 whether the _hash actually has been set by a call to invalidate(Hash) ever.
 

Static Protected Attributes

static Hash sInitialGeoHash
 
static Hash sInitialCacheHash
 

Friends

class GeometryList
 
std::ostream & operator<< (std::ostream &, const GeoOp &)
 

Additional Inherited Members

- Public Types inherited from DD::Image::Op
enum  HandlesMode { eNoHandles, eHandlesUncooked, eHandlesCooked, eHandlesMax }
 
enum  PrevalidateResult { eFinished, eCancelled, eAbandoned }
 This is a tribool return value. Do not extend.
 
enum  HandleType {
  eNone, eMouseLeftClick, eMouseRightClick, eMouseMove,
  eMouseDrag, eMouseRelease, eSelectionChanged, eSelectionChangeFinished,
  eHandleDragTranslate, eHandleDragRotate, eHandleDragScale, eHandleDragPivot,
  eAllHandles
}
 
enum  ViewableModes { eViewableMode2D, eViewableMode3D, eViewableMode3D_2DReference }
 
enum  GenerateType {
  OUTPUT_OP, ANY_CONTEXT, INPUT_OP, INPUT_OP_PEEK,
  EXECUTABLE, EXECUTABLE_SKIP, EXECUTABLE_INPUT, UICONTEXT_ONLY
}
 
enum  NodeContext { eNodeGraph, eTimeline, eOpGraph }
 
enum  StatusFlags { StatusNone, StatusModal, StatusUseCallback }
 
enum  PopUpScheme {
  ePU_Never, ePU_Done, ePU_Once, ePU_Default,
  ePU_Always
}
 Pop-up schemes determine when pop-up messages are displayed for op errors. More...
 
enum  VersionComponents { eMajor, eMinor, ePoint, eRevision }
 
typedef std::pair< int, DD::Image::Op * > Output
 Combination of input number and pointer to Op.
 
typedef std::set< OutputOutputSet
 Set of all outputs from this Op.
 
typedef std::map< Hash, std::vector< unsigned int > > ItemSelectionList
 
typedef bool( EventCallback) (Op *op, EventContext eventCtx)
 
using VersionInfo = std::tuple< int, int, int, int >
 
- Public Attributes inherited from DD::Image::Op
const MetaData::BundlemetaCache
 
Hash metaCacheHash
 
- Static Public Attributes inherited from DD::Image::Op
static unsigned current_request_pass
 
static void(* node_redraw_cb )(const Op *)
 
static void(* print_name_cb )(std::ostream &, const Op *)
 
static void(* status_callback )(const Op *, float, float, const char *, StatusFlags)
 
static constexpr int kInvalidVersion
 
static constexpr VersionInfo kUnsetVersion
 

Detailed Description

Base class for an Op that produces a GeoInfo. The data is accessed by calling geometry_engine() and passing it a Scene to add a new GeoInfo to.

Constructor & Destructor Documentation

GeoOp::~GeoOp ( )
virtual

Base class destructor destroys the cache if there is one.

References delete_cache(), and scene_.

GeoOp::GeoOp ( Node *  node)
protected

Base class constructor.

Only subclasses can create an instance.

References backface_culling_, cache_hash, cache_list, display3d_, geo_hash, rebuild_mask_, render_mode_, scene_, and selectable_.

Member Function Documentation

void GeoOp::build_scene ( Scene scene)

Start the geometry construction process. This would typically be called directly by a viewer, renderer or write node. If the scene's hash are different than the geo's, rebuild the scene. The output object list/cache is filled in by the GeoOp tree during the geometry_engine() call. To reduce having to constantly recalculate primitive structures, we only rebuild those geometry groups whose rebuild flag is set in the cache's rebuild_mask.

References DD::Image::GeoInfo::Cache::attributes, cache_list, DD::Image::Op::Class(), DD::Image::Scene::clear_lights(), DD::Image::Box3::empty(), geo_hash, get_geometry(), DD::Image::Mask_Attributes, DD::Image::Mask_Matrix, DD::Image::Mask_Object, DD::Image::Mask_Points, DD::Image::Mask_Primitives, DD::Image::GeoInfo::matrix, DD::Image::Scene::object_list_, DD::Image::GeoInfo::Cache::points, DD::Image::GeoInfo::Cache::primitives, rebuild_mask_, DD::Image::GeoInfo::recursion_geo, DD::Image::GeoInfo::Cache::recursion_mask, DD::Image::GeoInfo::selected_items_list, DD::Image::GeoInfo::source_geo, DD::Image::GeometryList::synchronize_objects(), DD::Image::Box3::transform(), and DD::Image::GeoInfo::validate().

Referenced by DD::Image::Render::_validate(), and setupScene().

void GeoOp::setupScene ( )

Create a scene if necessary and do prerequisite setup to allow drawing

References assign_drawlists(), build_scene(), DD::Image::Scene::object_list_, scene_, and DD::Image::GeometryList::size().

Referenced by add_draw_geometry().

bool GeoOp::evaluate_transform ( int  obj,
GeometryList out,
bool  transform_normals = true 
)

Check if matrix is non-identity and if so, apply it to all the points. This 'cooks' the matrix into the points so that subsequent modifiers get the points in the correct space. The matrix is reset to identity.

References DD::Image::Attribute::array(), DD::Image::GeoInfo::Cache::attributes, DD::Image::Matrix4::inverse(), DD::Image::Matrix4::makeIdentity(), DD::Image::Mask_Points, DD::Image::GeoInfo::matrix, DD::Image::NORMAL_ATTRIB, DD::Image::Matrix4::ntransform(), DD::Image::Attribute::size(), and transform_points().

Referenced by DD::Image::ModifyGeo::geometry_engine().

void GeoOp::transform_points ( PointList *  out,
const PointList *  in,
const Matrix4 m 
)
static

Transform all points by a matrix.

Referenced by evaluate_transform().

void GeoOp::transform_points ( PointList *  out,
const PointList *  in,
int  start,
int  end,
const Matrix4 m 
)
static

Transform a range of points by a matrix.

References DD::Image::end(), and DD::Image::Matrix4::transform().

Op * GeoOp::default_input ( int  input) const
overridevirtual

Return a default op for input0.

Reimplemented from DD::Image::Op.

Reimplemented in DD::Image::TransformGeo.

Referenced by DD::Image::TransformGeo::default_input().

bool GeoOp::test_input ( int  input,
Op op 
) const
overridevirtual

Allows only GeoOp.

Reimplemented from DD::Image::Op.

Reimplemented in DD::Image::TransformGeo.

const char * GeoOp::node_shape ( ) const
overridevirtual

Draw a round sided box.

Reimplemented from DD::Image::Op.

int GeoOp::knob_changed ( Knob k)
overridevirtual

Forces tile_color & gl_color knob changes to update op.

Reimplemented from DD::Image::Op.

Reimplemented in DD::Image::ReadGeo.

References DD::Image::Op::invalidate(), DD::Image::Op::knob(), DD::Image::Knob::NO_KNOB_CHANGED, and DD::Image::Knob::showPanel.

Referenced by DD::Image::ReadGeo::knob_changed().

void GeoOp::build_handles ( ViewerContext ctx)
overridevirtual

Internally this calls build_matrix_handles with a NULL matrix

Reimplemented from DD::Image::Op.

Reimplemented in DD::Image::TransformGeo.

References build_matrix_handles().

void GeoOp::select_geometry ( ViewerContext ctx,
GeometryList scene_objects 
)
virtual

Search up the tree to set the selected nodes and bounding box based on whether user has nodes selected and/or open.

References DD::Image::GeoInfo::display3d, DD::Image::Op::input(), DD::Image::Op::node_selected(), DD::Image::GeoInfo::select_geo, select_geometry(), DD::Image::GeoInfo::selectable, and DD::Image::GeoInfo::selected.

Referenced by add_draw_geometry(), and select_geometry().

void GeoOp::assign_drawlists ( int  obj,
GeoInfo info 
)

Assigns the current drawlist allocation for object obj to the GeoInfo. If it doesn't exist yet create it.

References cache_list, and DD::Image::GeoInfo::Cache::call_lists.

Referenced by setupScene().

const GeometryMask& DD::Image::GeoOp::rebuild_mask ( ) const
inline

What groups need updating.

Referenced by get_geometry().

void GeoOp::_validate ( bool  for_real)
overrideprotectedvirtual

GeoOp subclass-dependent portion of validate(). This builds

Reimplemented from DD::Image::Op.

Reimplemented in DD::Image::ReadGeo, and DD::Image::TransformGeo.

References DD::Image::Op::_validate(), and update_geometry_hashes().

Referenced by DD::Image::ReadGeo::_validate().

void GeoOp::update_geometry_hashes ( )
protected

Calculate the geometry hashes. If the hashes are different from the cache's, set the cache rebuild flags.

References cache_hash, display3d_, geo_hash, get_geometry_hash(), DD::Image::Op::node(), DD::Image::Op::node_gl_color(), rebuild_mask_, render_mode_, and selectable_.

Referenced by DD::Image::TransformGeo::_validate(), and _validate().

void GeoOp::get_geometry_hash ( )
protectedvirtual

Return a hash value which indicates the out-of-dateness of the object's primitives. The default implementation validates the passed-in GeoOp and copies its hashes. If the GeoOp depends on an input's geometry this should be called prior to other knob hashes being applied.

Reimplemented in DD::Image::ReadGeo, DD::Image::SourceGeo, DD::Image::TransformGeo, and DD::Image::NullGeo.

References geo_hash, DD::Image::Hash::reset(), and DD::Image::Op::validate().

Referenced by DD::Image::TransformGeo::get_geometry_hash(), and update_geometry_hashes().

void GeoOp::delete_cache ( )
protected

Delete all locally allocated geometry and clear the cache.

References cache_list, and delete_allocations().

Referenced by DD::Image::GeometryList::delete_objects(), and ~GeoOp().

void GeoOp::synchronize_cache ( GeometryList out)
protected

Synchronize the local cache objects with the output GeometryList. For an empty output this simply means adding objects to it, otherwise if a higher up GeoOp has already added objects we must compare our cache objects against the output objects and resolve any differences.

For each object in the local cache find the corresponding object in the output list. Rearrange, add or delete if different. Two pieces of information are needed for this: 1) The unique hash id derived from the originating GeoOp Node and the index of the object. 2) The version number, or copy number, incremented at each split. We must handle cases of an object disappearing from the output as well as new objects appearing. There are two distinct update phases we must handle: The cache being brand new and the cache already existing but objects are in a different order.

References DD::Image::GeoInfo::Cache::bbox, cache_list, DD::Image::GeoInfo::Cache::call_lists, DD::Image::GeoInfoRenderState::castShadow, delete_allocations(), DD::Image::GeoInfo::display3d, DD::Image::GeoInfo::final_geo, DD::Image::GeoInfo::Cache::out_id, DD::Image::GeoInfo::Cache::points, DD::Image::GeoInfo::Cache::primitives, DD::Image::GeoInfoRenderState::receiveShadow, DD::Image::GeoInfo::Cache::recursion_mask, DD::Image::GeoInfo::render_mode, DD::Image::GeoInfo::selectable, selectable_, DD::Image::GeoInfo::source_node_gl_color, DD::Image::GeoInfo::Cache::src_id, DD::Image::GeoInfo::Cache::type, DD::Image::GeoInfo::valid_source_node_gl_color, DD::Image::version(), DD::Image::GeoInfo::Cache::version, and DD::Image::GeoInfo::Cache::vertices.

Referenced by DD::Image::GeometryList::synchronize_objects().

void GeoOp::delete_allocations ( GeoInfo::Cache cache)
protected
void GeoOp::geometry_engine ( Scene scene,
GeometryList out 
)
protectedvirtual

Sub-class dependent portion of get_geometry(). This should be implemented on plugins to construct geometry. The default implementation gets the input's geometry.

Reimplemented in DD::Image::ReadGeo, DD::Image::SourceGeo, DD::Image::TransformGeo, DD::Image::ModifyGeo, and DD::Image::NullGeo.

References get_geometry().

Referenced by get_geometry().

void GeoOp::add_draw_geometry ( ViewerContext ctx)
protected

Subclasses can call this in build_handles(). It will construct the output geometry and add callbacks to draw it in the viewer. You should only call this if ctx->connected is >= SHOW_OBJECT and should then set ctx->connected to CONNECTED before calling any inputs, so that objects are not drawn more than once. Also you must call validate(false) before this.

References DD::Image::ViewerContext::add_draw_handle(), DD::Image::Box3::empty(), DD::Image::ViewerContext::expand_bbox(), DD::Image::Matrix4::makeIdentity(), DD::Image::GeoInfo::matrix, DD::Image::ViewerContext::modelmatrix, DD::Image::Op::node(), DD::Image::Op::node_selected(), DD::Image::Scene::object_list_, scene_, DD::Image::GeoInfo::select_geo, select_geometry(), DD::Image::GeoInfo::selected, setupScene(), DD::Image::SHOW_BBOX, DD::Image::GeoInfo::source_geo, and DD::Image::Box3::transform().

Referenced by DD::Image::TransformGeo::build_handles(), and build_matrix_handles().

Member Data Documentation



©2022 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.thefoundry.co.uk