|
Houdini Development Toolkit - Version 6.5
Side Effects Software Inc. 2004
|
Geometry
Primitive Base Class
Houdini supports a number of new primitive types.
These types are broken into a hierarchy of class types:
- GEO_Primitive
- GEO_Face
- GEO_PrimPoly
- GEO_Curve
- GEO_PrimNURBCurve
- GEO_PrimRBezCurve
- GEO_Hull
- GEO_PrimMesh
- GEO_TPSurf
- GEO_PrimNURBSurf
- GEO_PrimRBezSurf
- GEO_Quadric
- GEO_PrimCircle
- GEO_PrimSphere
- GEO_PrimTube
- GEO_PrimParticle
- GEO_MetaPrim
- GEO_PrimMetaBall
- GEO_PrimMetaSQuad
The GEO_Primitive class contains a number of public methods, the most
significant of which are:
Primitive Instantiation Classes
None of the leaf GEO primitive classes can be instantiated. To build a
primitive within the geometry detail you must use the GU library.
A GU primitive is multiply derived from GEO_Primitive and GU_Primitive.
The GU hierarchy is listed below:
- GEO_Detail
- GU_Primitive
- GEO_PrimPoly and GU_Primitive
- GEO_PrimNURBCurve and GU_Curve
- GEO_PrimRBezCurve and GU_Curve
- GEO_PrimMesh and GU_Primitive
- GEO_PrimNURBSurf and GU_TPSurf
- GEO_PrimRBezSurf and GU_TPSurf
- GEO_PrimCircle and GU_Primitive
- GEO_PrimSphere and GU_Primitive
- GEO_PrimTube and GU_Primitive
- GEO_PrimParticle and GU_Primitive
- GEO_PrimMetaBall and GU_Primitive
- GEO_PrimMetaSQuad and GU_Primitive
Each leaf in the hierarchy, aside from GU_Curve and GU_TPSurf, can be
instantiated by calling either its constructor or the class static
::build() method.
The constructor does not sufficiently initialize the data structure, and
is meant to be used mostly internally. Therefore, we strongly recommend
that you always use the ::build() method for instantiation.
The code below illustrates how to create a closed, 4 point polygon:
GU_Detail gdp;
GU_PrimPoly *poly;
if (poly = GU_PrimPoly::build(&gdp, 4, GU_POLY_CLOSED))
{
// Assign some value to each vertex:
for (int i = 0; i < poly->getVertexCount(); i++)
(*poly)(i).getPos().assign(i,0,0,1);
}
To delete a primitive, you need to delete it from the gdp which
contains it. Calling "delete prim;" is dangerous as the primitive
will not be removed from the gdp. Instead, to delete a primitive
created by the previous code, use:
gdp->deletePrimitive(poly);
Note that you do not have to explicitly call "delete poly;" yourself,
as the deletePrimitive method will do that for you.
GU_Primitive is a verb class that defines basic utility operations to be
implemented by the derived classes. The most significant GU_Primitive methods
are:
If you are working with a GEO_Primitive pointer but want to call a
GU_Primitive method, you must use the GEO_Primitive::castTo() method
before doing so. The reason is that all GU primitives are multiply derived
from GEO_Primitive and GU_Primitive, and GU_Primitive appears last in the
inheritance list:
GEO_Primitive *prim;
((GU_Primitive*)prim->castTo())->normal(0);
Although GU_Primitive contains a fair number of utility methods, most high
level operations are defined in GU_Detail (geometry detail),
the container of all primitives, points, groups, and attributes.
Table of Contents
Operators |
Surface Operations |
Particle Operations |
Composite Operators |
Channel Operators
Material & Texture |
Objects |
Command and Expression |
Render Output |
Mantra Shaders |
Utility Classes |
Geometry Library |
Image Library |
Clip Library
Customizing UI |
Questions & Answers
Copyright © 2004 Side Effects Software Inc.
477 Richmond Street West, Toronto, Ontario, Canada M5V 3E7