Nuke binary plugins 15.0.5
 
Loading...
Searching...
No Matches
DD::Image::Polygon Class Reference

#include <Polygon.h>

Inheritance diagram for DD::Image::Polygon:
DD::Image::PolygonPrimitive DD::Image::Primitive

Public Member Functions

const char * Class () const override
 
 Polygon (unsigned vertices, bool closed)
 
 Polygon (int p0, int p1, bool closed)
 
 Polygon (int p0, int p1, int p2, bool closed)
 
 Polygon (int p0, int p1, int p2, int p3, bool closed)
 
 Polygon (const Polygon &)
 
Polygonoperator= (const Polygon &b)
 
Primitiveduplicate () const override
 
bool closed () const
 
void closed (bool v)
 
bool IntersectsRay (const Ray &ray, int n, const PointList *pointList, CollisionResult *result) const override
 
void validate (PrimitiveContext *) override
 
void tessellate (Scene *, PrimitiveContext *) const override
 
unsigned faces () const override
 
void draw_wireframe (ViewerContext *, PrimitiveContext *, Primitive *prev_prim=nullptr) const override
 
void draw_solid (ViewerContext *, PrimitiveContext *, Primitive *prev_prim=nullptr) const override
 
void draw_solid_face (int n, ViewerContext *, PrimitiveContext *) const override
 
void draw_primitive_num (ViewerContext *, PrimitiveContext *) const override
 
void draw_primitive_normal (ViewerContext *, PrimitiveContext *) const override
 
void print_info () const override
 
PrimitiveType getPrimitiveType () const override
 
- Public Member Functions inherited from DD::Image::PolygonPrimitive
 PolygonPrimitive (unsigned vertices=0)
 
void tessellate (Scene *, PrimitiveContext *) const override
 
virtual void tessellateFace (int faceIndex, Scene *scene, PrimitiveContext *ptx, VertexContext *vtx) const
 
- Public Member Functions inherited from DD::Image::Primitive
virtual void vertex_shader (int v, Scene *, PrimitiveContext *, VArray &out, const Vector3 *normal=nullptr) const
 
virtual void vertex_shader (int v, Scene *, PrimitiveContext *, VertexContext &, VArray &out, const Vector3 *normal=nullptr) const
 
 Primitive (unsigned vertices=0)
 
 Primitive (const Primitive &)
 
virtual ~Primitive ()
 
virtual const char * Class () const =0
 
virtual Primitiveduplicate () const =0
 
void getDataArray (int n, ViewerContext *ctx, PrimitiveContext *ptx, std::vector< Vector3 > &pntArray, std::vector< Vector3 > &normalArray, std::vector< Vector4 > &uvOrColArray, bool &validUV) const
 
const unsigned & vertex (unsigned v) const
 
unsigned & vertex (unsigned v)
 
unsigned vertices () const
 
void offset_point_indices (int offset)
 
unsigned vertex_offset () const
 
void build_index_array (unsigned *indices, unsigned primitive, unsigned vertex) const
 
unsigned add_vertex (unsigned point_index)
 
unsigned add_vertices (unsigned num)
 
virtual Vector3 average_center (const PointList *) const
 Returns the xyz center average of the primitive.
 
virtual Vector3 average_center_and_bounds (int f, const PointList *points, Vector3 &min, Vector3 &max) const
 
virtual unsigned faces () const =0
 
virtual Vector3 face_average_center (int n, const PointList *points) const
 
virtual unsigned face_vertices (int n) const
 
virtual void get_face_vertices (int n, unsigned *array) const
 
virtual Box3 get_bbox (const GeoInfo *info) const
 
virtual Vector3 get_face_normal (int n, const PointList *points) const
 
virtual Vector3 get_geometric_normal (int v, const PointList *points) const
 
virtual int get_vertex_faces (int v, std::vector< int > &faces) const
 
virtual bool IntersectsRay (const Ray &ray, int n, const PointList *pointList, CollisionResult *result) const
 
virtual void validate (PrimitiveContext *)
 
virtual bool faceUsesVertex (unsigned int faceIdx, unsigned int vertIdx) const
 
Iopmaterial () const
 
IoprenderingShader (const GeoInfo *info) const
 
const Vector3normal () const
 
virtual Vector3 vertex_normal (unsigned v, const PointList *) const
 
virtual void tessellate (Scene *, PrimitiveContext *) const =0
 
virtual void draw_wireframe (ViewerContext *, PrimitiveContext *, Primitive *prev_prim=nullptr) const =0
 
virtual void draw_solid (ViewerContext *, PrimitiveContext *, Primitive *prev_prim=nullptr) const =0
 
virtual void draw_solid_face (int n, ViewerContext *, PrimitiveContext *) const
 
virtual void draw_primitive_normal (ViewerContext *, PrimitiveContext *) const
 
virtual void draw_primitive_num (ViewerContext *, PrimitiveContext *) const
 
virtual void draw_vertex_num (ViewerContext *, PrimitiveContext *) const
 
virtual void draw_vertex_normals (ViewerContext *, PrimitiveContext *) const
 
virtual void draw_vertex_uvs (ViewerContext *, PrimitiveContext *) const
 
virtual void print_info () const
 
virtual PrimitiveType getPrimitiveType () const
 
void * operator new (size_t size)
 
void operator delete (void *mem)
 
void * operator new[] (size_t size)
 
void operator delete[] (void *mem)
 

Protected Member Functions

void copy (const Polygon *)
 
- Protected Member Functions inherited from DD::Image::Primitive
void draw_wireframe_vertex (int v, ViewerContext *, PrimitiveContext *) const
 
void draw_solid_vertex (int v, ViewerContext *, PrimitiveContext *) const
 
void copy (const Primitive *)
 
bool PolyIntersectsRay (const Ray &ray, int n, const PointList *pointList, CollisionResult *result) const
 

Protected Attributes

bool closed_
 
- Protected Attributes inherited from DD::Image::Primitive
std::vector< unsigned, STL3DAllocator< unsigned > > vertex_
 Point indices.
 
unsigned vertex_offset_
 Vertex attribute starting index.
 
Vector3 normal_
 Normal determined from vertex positions.
 
Iopmaterial_
 Material assignment.
 

Additional Inherited Members

- Static Public Member Functions inherited from DD::Image::Primitive
static void draw_normal (const Vector3 &p, const Vector3 &n, ViewerContext *, PrimitiveContext *)
 

Detailed Description

Polygon primtive class consisting of n vertices. Can be defined as open or closed. If closed, the edge between the first and last vertex is added. All vertices must be coplanar otherwise unpredictable results will occur.

Member Function Documentation

◆ copy()

void Polygon::copy ( const Polygon b)
protected

Destructive copy.

References DD::Image::Primitive::copy(), and DD::Image::Primitive::normal_.

◆ Class()

const char * Polygon::Class ( ) const
overridevirtual

Implements DD::Image::Primitive.

◆ duplicate()

Primitive * Polygon::duplicate ( ) const
overridevirtual

Copy this Polygon into a new one, and return a pointer to it. Vertex data is duplicated, point indices are unchanged.

Implements DD::Image::Primitive.

◆ closed()

bool DD::Image::Polygon::closed ( ) const
inline

Indicated whether the polygon is open or closed. If closed, the edge between the first and last vertex is added.

◆ IntersectsRay()

bool DD::Image::Polygon::IntersectsRay ( const Ray ray,
int  n,
const PointList pointList,
CollisionResult *  result 
) const
inlineoverridevirtual

Test for the intersection of this primitive with a given ray .

Reimplemented from DD::Image::Primitive.

◆ validate()

void Polygon::validate ( PrimitiveContext ptx)
overridevirtual

Reimplemented from DD::Image::Primitive.

◆ tessellate()

void Polygon::tessellate ( Scene scene,
PrimitiveContext ptx 
) const
overridevirtual

Subdivide the polygon into triangles and add them to the rendering pipeline.

Implements DD::Image::Primitive.

◆ faces()

unsigned DD::Image::Polygon::faces ( ) const
inlineoverridevirtual

Implements DD::Image::Primitive.

◆ draw_wireframe()

void Polygon::draw_wireframe ( ViewerContext ctx,
PrimitiveContext ptx,
Primitive prev_prim = nullptr 
) const
overridevirtual

Implements DD::Image::Primitive.

◆ draw_solid()

void Polygon::draw_solid ( ViewerContext ctx,
PrimitiveContext ptx,
Primitive prev_prim = nullptr 
) const
overridevirtual

Implements DD::Image::Primitive.

◆ draw_solid_face()

void Polygon::draw_solid_face ( int  n,
ViewerContext ctx,
PrimitiveContext ptx 
) const
overridevirtual

Draw the single face as a filled polygon.

Reimplemented from DD::Image::Primitive.

◆ draw_primitive_num()

void Polygon::draw_primitive_num ( ViewerContext ctx,
PrimitiveContext ptx 
) const
overridevirtual

Reimplemented from DD::Image::Primitive.

◆ draw_primitive_normal()

void Polygon::draw_primitive_normal ( ViewerContext ctx,
PrimitiveContext ptx 
) const
overridevirtual

Reimplemented from DD::Image::Primitive.

◆ print_info()

void Polygon::print_info ( ) const
overridevirtual

Reimplemented from DD::Image::Primitive.

◆ getPrimitiveType()

PrimitiveType DD::Image::Polygon::getPrimitiveType ( ) const
inlineoverridevirtual

Reimplemented from DD::Image::Primitive.



©2024 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.foundry.com