Updated wrappers
This commit is contained in:
@@ -192,7 +192,7 @@ SOURCE=..\..\..\src\osgWrappers\osgUtil\TangentSpaceGenerator.cpp
|
||||
# End Source File
|
||||
|
||||
# Begin Source File
|
||||
SOURCE=..\..\..\src\osgWrappers\osgUtil\Tesselator.cpp
|
||||
SOURCE=..\..\..\src\osgWrappers\osgUtil\Tessellator.cpp
|
||||
# End Source File
|
||||
|
||||
# Begin Source File
|
||||
|
||||
@@ -1,246 +0,0 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef OSGUTIL_Tesselator
|
||||
#define OSGUTIL_Tesselator
|
||||
|
||||
#include <osg/Geometry>
|
||||
|
||||
#include <osgUtil/Export>
|
||||
|
||||
#include <osg/GLU>
|
||||
|
||||
#include <vector>
|
||||
|
||||
/* Win32 calling conventions. (or a least thats what the GLUT example tess.c uses.)*/
|
||||
#ifndef CALLBACK
|
||||
#define CALLBACK
|
||||
#endif
|
||||
|
||||
|
||||
namespace osgUtil {
|
||||
|
||||
/** Originally a simple class for tessellating a single polygon boundary.
|
||||
* Using old style glu tessellation functions for portability.
|
||||
* Upgraded Jan 2004 to use the modern glu tessellation functions.*/
|
||||
|
||||
class OSGUTIL_EXPORT Tesselator : public osg::Referenced
|
||||
{
|
||||
public:
|
||||
|
||||
Tesselator();
|
||||
~Tesselator();
|
||||
|
||||
/** The winding rule, see red book ch 11. */
|
||||
enum WindingType{
|
||||
TESS_WINDING_ODD = GLU_TESS_WINDING_ODD,
|
||||
TESS_WINDING_NONZERO = GLU_TESS_WINDING_NONZERO ,
|
||||
TESS_WINDING_POSITIVE = GLU_TESS_WINDING_POSITIVE ,
|
||||
TESS_WINDING_NEGATIVE = GLU_TESS_WINDING_NEGATIVE ,
|
||||
TESS_WINDING_ABS_GEQ_TWO = GLU_TESS_WINDING_ABS_GEQ_TWO
|
||||
} ;
|
||||
|
||||
/** we interpret all contours in the geometry as a single set to be tesselated or
|
||||
* each separate drawable's contours needs to be tesselated. */
|
||||
enum TesselationType {
|
||||
TESS_TYPE_GEOMETRY, // tesselate everything in the geometry object
|
||||
TESS_TYPE_DRAWABLE, // tesselate each polygon, triangles & quads drawables in geometry separately
|
||||
TESS_TYPE_POLYGONS // tesselate ONLY polygon drawables in geometry separately
|
||||
};
|
||||
|
||||
/** Set and get tesselation request boundary only on/off */
|
||||
void setBoundaryOnly (const bool tt) { _boundaryOnly=tt;}
|
||||
inline const bool getBoundaryOnly ( ) { return _boundaryOnly;}
|
||||
|
||||
/** Set and get tesselation windong rule */
|
||||
void setWindingType (const WindingType wt) { _wtype=wt;}
|
||||
inline const WindingType getWindingType ( ) { return _wtype;}
|
||||
|
||||
/** Set and get tesselation type */
|
||||
void setTesselationType (const TesselationType tt) { _ttype=tt;}
|
||||
inline const TesselationType getTesselationType ( ) { return _ttype;}
|
||||
|
||||
/** Change the contours lists of the geometry into tesselated primitives (the
|
||||
* list of primitives in the original geometry is stored in the tesselator for
|
||||
* possible re-use.
|
||||
* The name remains retesselatePolygons although it now handles trifans, strips, quads etc.
|
||||
* as well as Polygons so as to not break old codes relying on this function name. */
|
||||
void retesselatePolygons(osg::Geometry &cxgeom);
|
||||
|
||||
/** Define the normal to the tesselated polygon - this provides a hint how to
|
||||
* tesselate the contours; see gluTessNormal in red book or man pages.
|
||||
* GWM July 2005. Can improve teselation
|
||||
* "For example, if you know that all polygons lie in the x-y plane,
|
||||
* call gluTessNormal(tess, 0.0, 0.0, 1.0) before rendering any polygons."
|
||||
*/
|
||||
void setTesselationNormal(const osg::Vec3 norm) { tessNormal=norm;}
|
||||
|
||||
osg::Geometry::PrimitiveSetList getContours() { return _Contours;}
|
||||
|
||||
typedef std::vector<osg::Vec3*> VertexPointList;
|
||||
|
||||
struct Prim : public osg::Referenced
|
||||
{
|
||||
Prim(GLenum mode):_mode(mode) {}
|
||||
|
||||
typedef std::vector<osg::Vec3*> VecList;
|
||||
|
||||
GLenum _mode;
|
||||
VecList _vertices;
|
||||
};
|
||||
|
||||
void beginTesselation();
|
||||
|
||||
void beginContour();
|
||||
void addVertex(osg::Vec3* vertex);
|
||||
void endContour();
|
||||
|
||||
void endTesselation();
|
||||
|
||||
typedef std::vector< osg::ref_ptr<Prim> > PrimList;
|
||||
|
||||
PrimList& getPrimList() { return _primList; }
|
||||
|
||||
void reset();
|
||||
|
||||
protected:
|
||||
|
||||
/** remove unused parts of the array, eg for wehn retesselating
|
||||
* tesselation can introduce extra vertices for concave or crossing boundaries,
|
||||
* these will leak memory if not removed when retesselating. */
|
||||
void reduceArray(osg::Array * cold, const unsigned int nnu);
|
||||
|
||||
void collectTesselation(osg::Geometry &cxgeom, unsigned int originalIndex);
|
||||
|
||||
typedef std::map<osg::Vec3*,unsigned int> VertexPtrToIndexMap;
|
||||
void addContour(GLenum mode, unsigned int first, unsigned int last, osg::Vec3Array* vertices);
|
||||
void addContour(osg::PrimitiveSet* primitive, osg::Vec3Array* vertices);
|
||||
void handleNewVertices(osg::Geometry& geom,VertexPtrToIndexMap &vertexPtrToIndexMap);
|
||||
|
||||
void begin(GLenum mode);
|
||||
void vertex(osg::Vec3* vertex);
|
||||
void combine(osg::Vec3* vertex,void* vertex_data[4],GLfloat weight[4]);
|
||||
void end();
|
||||
void error(GLenum errorCode);
|
||||
|
||||
|
||||
static void CALLBACK beginCallback(GLenum which, void* userData);
|
||||
static void CALLBACK vertexCallback(GLvoid *data, void* userData);
|
||||
static void CALLBACK combineCallback(GLdouble coords[3], void* vertex_data[4],
|
||||
GLfloat weight[4], void** outData,
|
||||
void* useData);
|
||||
static void CALLBACK endCallback(void* userData);
|
||||
static void CALLBACK errorCallback(GLenum errorCode, void* userData);
|
||||
|
||||
|
||||
struct Vec3d
|
||||
{
|
||||
double _v[3];
|
||||
};
|
||||
|
||||
|
||||
struct NewVertex
|
||||
{
|
||||
|
||||
NewVertex():
|
||||
_vpos(0),
|
||||
_f1(0),
|
||||
_v1(0),
|
||||
_f2(0),
|
||||
_v2(0),
|
||||
_f3(0),
|
||||
_v3(0),
|
||||
_f4(0),
|
||||
_v4(0) {}
|
||||
|
||||
NewVertex(const NewVertex& nv):
|
||||
_vpos(nv._vpos),
|
||||
_f1(nv._f1),
|
||||
_v1(nv._v1),
|
||||
_f2(nv._f2),
|
||||
_v2(nv._v2),
|
||||
_f3(nv._f3),
|
||||
_v3(nv._v3),
|
||||
_f4(nv._f4),
|
||||
_v4(nv._v4) {}
|
||||
|
||||
NewVertex(osg::Vec3* vx,
|
||||
float f1,osg::Vec3* v1,
|
||||
float f2,osg::Vec3* v2,
|
||||
float f3,osg::Vec3* v3,
|
||||
float f4,osg::Vec3* v4):
|
||||
_vpos(vx),
|
||||
_f1(f1),
|
||||
_v1(v1),
|
||||
_f2(f2),
|
||||
_v2(v2),
|
||||
_f3(f3),
|
||||
_v3(v3),
|
||||
_f4(f4),
|
||||
_v4(v4) {}
|
||||
|
||||
osg::Vec3 *_vpos; // added gwm Jan 2004 the vertex coords s.t. NewVertex can be used in a std::vector
|
||||
|
||||
float _f1;
|
||||
osg::Vec3* _v1;
|
||||
|
||||
float _f2;
|
||||
osg::Vec3* _v2;
|
||||
|
||||
float _f3;
|
||||
osg::Vec3* _v3;
|
||||
|
||||
float _f4;
|
||||
osg::Vec3* _v4;
|
||||
|
||||
};
|
||||
|
||||
//change NewVertexList from std::map<osg::Vec3*,NewVertex> NewVertexList;
|
||||
// because this has undefined order of insertion for new vertices.
|
||||
// which occasionally corrupted the texture mapping.
|
||||
typedef std::vector<NewVertex> NewVertexList;
|
||||
typedef std::vector<Vec3d*> Vec3dList;
|
||||
|
||||
GLUtesselator* _tobj;
|
||||
PrimList _primList;
|
||||
Vec3dList _coordData;
|
||||
NewVertexList _newVertexList;
|
||||
GLenum _errorCode;
|
||||
|
||||
/** winding rule, which parts will become solid */
|
||||
WindingType _wtype;
|
||||
|
||||
/** tesselation rule, which parts will become solid */
|
||||
TesselationType _ttype;
|
||||
|
||||
bool _boundaryOnly; // see gluTessProperty - if true: make the boundary edges only.
|
||||
|
||||
/** number of vertices that are part of the 'original' set of contours */
|
||||
unsigned int _numberVerts;
|
||||
|
||||
/** List of primitives that define the contours */
|
||||
osg::Geometry::PrimitiveSetList _Contours;
|
||||
|
||||
/** count number of primitives in a geometry to get right no. of norms/colurs etc for per_primitive attributes. */
|
||||
unsigned int _index;
|
||||
|
||||
/** the gluTessNormal for tesselation hint */
|
||||
osg::Vec3 tessNormal;
|
||||
|
||||
/** count of number of extra primitives added */
|
||||
unsigned int _extraPrimitives;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -93,6 +93,10 @@ BEGIN_OBJECT_REFLECTOR(osg::LightSource)
|
||||
__void__setLocalStateSetModes__StateAttribute_GLModeValue,
|
||||
"Set up the local StateSet. ",
|
||||
"");
|
||||
I_Method1(void, setThreadSafeRefUnref, IN, bool, threadSafe,
|
||||
__void__setThreadSafeRefUnref__bool,
|
||||
"Set whether to use a mutex to ensure ref() and unref() are thread safe. ",
|
||||
"");
|
||||
I_Method0(osg::BoundingSphere, computeBound,
|
||||
__BoundingSphere__computeBound,
|
||||
"Compute the bounding sphere around Node's geometry or children. ",
|
||||
@@ -106,5 +110,8 @@ BEGIN_OBJECT_REFLECTOR(osg::LightSource)
|
||||
I_SimpleProperty(osg::LightSource::ReferenceFrame, ReferenceFrame,
|
||||
__ReferenceFrame__getReferenceFrame,
|
||||
__void__setReferenceFrame__ReferenceFrame);
|
||||
I_SimpleProperty(bool, ThreadSafeRefUnref,
|
||||
0,
|
||||
__void__setThreadSafeRefUnref__bool);
|
||||
END_REFLECTOR
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ CXXFILES =\
|
||||
StateGraph.cpp\
|
||||
Statistics.cpp\
|
||||
TangentSpaceGenerator.cpp\
|
||||
Tesselator.cpp\
|
||||
Tessellator.cpp\
|
||||
TransformAttributeFunctor.cpp\
|
||||
TransformCallback.cpp\
|
||||
TriStripVisitor.cpp\
|
||||
|
||||
@@ -1,180 +0,0 @@
|
||||
// ***************************************************************************
|
||||
//
|
||||
// Generated automatically by genwrapper.
|
||||
// Please DO NOT EDIT this file!
|
||||
//
|
||||
// ***************************************************************************
|
||||
|
||||
#include <osgIntrospection/ReflectionMacros>
|
||||
#include <osgIntrospection/TypedMethodInfo>
|
||||
#include <osgIntrospection/StaticMethodInfo>
|
||||
#include <osgIntrospection/Attributes>
|
||||
|
||||
#include <osg/Geometry>
|
||||
#include <osg/Vec3>
|
||||
#include <osgUtil/Tesselator>
|
||||
|
||||
// Must undefine IN and OUT macros defined in Windows headers
|
||||
#ifdef IN
|
||||
#undef IN
|
||||
#endif
|
||||
#ifdef OUT
|
||||
#undef OUT
|
||||
#endif
|
||||
|
||||
TYPE_NAME_ALIAS(std::vector< osg::Vec3 * >, osgUtil::Tesselator::VertexPointList);
|
||||
|
||||
TYPE_NAME_ALIAS(std::vector< osg::ref_ptr< osgUtil::Tesselator::Prim > >, osgUtil::Tesselator::PrimList);
|
||||
|
||||
BEGIN_ENUM_REFLECTOR(osgUtil::Tesselator::WindingType)
|
||||
I_EnumLabel(osgUtil::Tesselator::TESS_WINDING_ODD);
|
||||
I_EnumLabel(osgUtil::Tesselator::TESS_WINDING_NONZERO);
|
||||
I_EnumLabel(osgUtil::Tesselator::TESS_WINDING_POSITIVE);
|
||||
I_EnumLabel(osgUtil::Tesselator::TESS_WINDING_NEGATIVE);
|
||||
I_EnumLabel(osgUtil::Tesselator::TESS_WINDING_ABS_GEQ_TWO);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_ENUM_REFLECTOR(osgUtil::Tesselator::TesselationType)
|
||||
I_EnumLabel(osgUtil::Tesselator::TESS_TYPE_GEOMETRY);
|
||||
I_EnumLabel(osgUtil::Tesselator::TESS_TYPE_DRAWABLE);
|
||||
I_EnumLabel(osgUtil::Tesselator::TESS_TYPE_POLYGONS);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osgUtil::Tesselator)
|
||||
I_BaseType(osg::Referenced);
|
||||
I_Constructor0(____Tesselator,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, setBoundaryOnly, IN, const bool, tt,
|
||||
__void__setBoundaryOnly__C5_bool,
|
||||
"Set and get tesselation request boundary only on/off. ",
|
||||
"");
|
||||
I_Method0(const bool, getBoundaryOnly,
|
||||
__C5_bool__getBoundaryOnly,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, setWindingType, IN, const osgUtil::Tesselator::WindingType, wt,
|
||||
__void__setWindingType__C5_WindingType,
|
||||
"Set and get tesselation windong rule. ",
|
||||
"");
|
||||
I_Method0(const osgUtil::Tesselator::WindingType, getWindingType,
|
||||
__C5_WindingType__getWindingType,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, setTesselationType, IN, const osgUtil::Tesselator::TesselationType, tt,
|
||||
__void__setTesselationType__C5_TesselationType,
|
||||
"Set and get tesselation type. ",
|
||||
"");
|
||||
I_Method0(const osgUtil::Tesselator::TesselationType, getTesselationType,
|
||||
__C5_TesselationType__getTesselationType,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, retesselatePolygons, IN, osg::Geometry &, cxgeom,
|
||||
__void__retesselatePolygons__osg_Geometry_R1,
|
||||
"Change the contours lists of the geometry into tesselated primitives (the list of primitives in the original geometry is stored in the tesselator for possible re-use. ",
|
||||
"The name remains retesselatePolygons although it now handles trifans, strips, quads etc. as well as Polygons so as to not break old codes relying on this function name. ");
|
||||
I_Method1(void, setTesselationNormal, IN, const osg::Vec3, norm,
|
||||
__void__setTesselationNormal__C5_osg_Vec3,
|
||||
"Define the normal to the tesselated polygon - this provides a hint how to tesselate the contours; see gluTessNormal in red book or man pages. ",
|
||||
"GWM July 2005. Can improve teselation \"For example, if you know that all polygons lie in the x-y plane, call gluTessNormal(tess, 0.0, 0.0, 1.0) before rendering any polygons.\"");
|
||||
I_Method0(osg::Geometry::PrimitiveSetList, getContours,
|
||||
__osg_Geometry_PrimitiveSetList__getContours,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, beginTesselation,
|
||||
__void__beginTesselation,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, beginContour,
|
||||
__void__beginContour,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, addVertex, IN, osg::Vec3 *, vertex,
|
||||
__void__addVertex__osg_Vec3_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, endContour,
|
||||
__void__endContour,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, endTesselation,
|
||||
__void__endTesselation,
|
||||
"",
|
||||
"");
|
||||
I_Method0(osgUtil::Tesselator::PrimList &, getPrimList,
|
||||
__PrimList_R1__getPrimList,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, reset,
|
||||
__void__reset,
|
||||
"",
|
||||
"");
|
||||
I_SimpleProperty(const bool, BoundaryOnly,
|
||||
__C5_bool__getBoundaryOnly,
|
||||
__void__setBoundaryOnly__C5_bool);
|
||||
I_SimpleProperty(osg::Geometry::PrimitiveSetList, Contours,
|
||||
__osg_Geometry_PrimitiveSetList__getContours,
|
||||
0);
|
||||
I_SimpleProperty(osgUtil::Tesselator::PrimList &, PrimList,
|
||||
__PrimList_R1__getPrimList,
|
||||
0);
|
||||
I_SimpleProperty(const osg::Vec3, TesselationNormal,
|
||||
0,
|
||||
__void__setTesselationNormal__C5_osg_Vec3);
|
||||
I_SimpleProperty(const osgUtil::Tesselator::TesselationType, TesselationType,
|
||||
__C5_TesselationType__getTesselationType,
|
||||
__void__setTesselationType__C5_TesselationType);
|
||||
I_SimpleProperty(const osgUtil::Tesselator::WindingType, WindingType,
|
||||
__C5_WindingType__getWindingType,
|
||||
__void__setWindingType__C5_WindingType);
|
||||
END_REFLECTOR
|
||||
|
||||
TYPE_NAME_ALIAS(std::vector< osg::Vec3 * >, osgUtil::Tesselator::Prim::VecList);
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osgUtil::Tesselator::Prim)
|
||||
I_BaseType(osg::Referenced);
|
||||
I_Constructor1(IN, GLenum, mode,
|
||||
____Prim__GLenum,
|
||||
"",
|
||||
"");
|
||||
I_PublicMemberProperty(GLenum, _mode);
|
||||
I_PublicMemberProperty(osgUtil::Tesselator::Prim::VecList, _vertices);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_VALUE_REFLECTOR(osg::ref_ptr< osgUtil::Tesselator::Prim >)
|
||||
I_Constructor0(____ref_ptr,
|
||||
"",
|
||||
"");
|
||||
I_Constructor1(IN, osgUtil::Tesselator::Prim *, ptr,
|
||||
____ref_ptr__T_P1,
|
||||
"",
|
||||
"");
|
||||
I_Constructor1(IN, const osg::ref_ptr< osgUtil::Tesselator::Prim > &, rp,
|
||||
____ref_ptr__C5_ref_ptr_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method0(osgUtil::Tesselator::Prim *, get,
|
||||
__T_P1__get,
|
||||
"",
|
||||
"");
|
||||
I_Method0(bool, valid,
|
||||
__bool__valid,
|
||||
"",
|
||||
"");
|
||||
I_Method0(osgUtil::Tesselator::Prim *, release,
|
||||
__T_P1__release,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, swap, IN, osg::ref_ptr< osgUtil::Tesselator::Prim > &, rp,
|
||||
__void__swap__ref_ptr_R1,
|
||||
"",
|
||||
"");
|
||||
I_SimpleProperty(osgUtil::Tesselator::Prim *, ,
|
||||
__T_P1__get,
|
||||
0);
|
||||
END_REFLECTOR
|
||||
|
||||
STD_VECTOR_REFLECTOR(std::vector< osg::Vec3 * >);
|
||||
|
||||
STD_VECTOR_REFLECTOR(std::vector< osg::ref_ptr< osgUtil::Tesselator::Prim > >);
|
||||
|
||||
180
src/osgWrappers/osgUtil/Tessellator.cpp
Normal file
180
src/osgWrappers/osgUtil/Tessellator.cpp
Normal file
@@ -0,0 +1,180 @@
|
||||
// ***************************************************************************
|
||||
//
|
||||
// Generated automatically by genwrapper.
|
||||
// Please DO NOT EDIT this file!
|
||||
//
|
||||
// ***************************************************************************
|
||||
|
||||
#include <osgIntrospection/ReflectionMacros>
|
||||
#include <osgIntrospection/TypedMethodInfo>
|
||||
#include <osgIntrospection/StaticMethodInfo>
|
||||
#include <osgIntrospection/Attributes>
|
||||
|
||||
#include <osg/Geometry>
|
||||
#include <osg/Vec3>
|
||||
#include <osgUtil/Tessellator>
|
||||
|
||||
// Must undefine IN and OUT macros defined in Windows headers
|
||||
#ifdef IN
|
||||
#undef IN
|
||||
#endif
|
||||
#ifdef OUT
|
||||
#undef OUT
|
||||
#endif
|
||||
|
||||
TYPE_NAME_ALIAS(std::vector< osg::Vec3 * >, osgUtil::Tessellator::VertexPointList);
|
||||
|
||||
TYPE_NAME_ALIAS(std::vector< osg::ref_ptr< osgUtil::Tessellator::Prim > >, osgUtil::Tessellator::PrimList);
|
||||
|
||||
BEGIN_ENUM_REFLECTOR(osgUtil::Tessellator::WindingType)
|
||||
I_EnumLabel(osgUtil::Tessellator::TESS_WINDING_ODD);
|
||||
I_EnumLabel(osgUtil::Tessellator::TESS_WINDING_NONZERO);
|
||||
I_EnumLabel(osgUtil::Tessellator::TESS_WINDING_POSITIVE);
|
||||
I_EnumLabel(osgUtil::Tessellator::TESS_WINDING_NEGATIVE);
|
||||
I_EnumLabel(osgUtil::Tessellator::TESS_WINDING_ABS_GEQ_TWO);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_ENUM_REFLECTOR(osgUtil::Tessellator::TessellationType)
|
||||
I_EnumLabel(osgUtil::Tessellator::TESS_TYPE_GEOMETRY);
|
||||
I_EnumLabel(osgUtil::Tessellator::TESS_TYPE_DRAWABLE);
|
||||
I_EnumLabel(osgUtil::Tessellator::TESS_TYPE_POLYGONS);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osgUtil::Tessellator)
|
||||
I_BaseType(osg::Referenced);
|
||||
I_Constructor0(____Tessellator,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, setBoundaryOnly, IN, const bool, tt,
|
||||
__void__setBoundaryOnly__C5_bool,
|
||||
"Set and get tessellation request boundary only on/off. ",
|
||||
"");
|
||||
I_Method0(const bool, getBoundaryOnly,
|
||||
__C5_bool__getBoundaryOnly,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, setWindingType, IN, const osgUtil::Tessellator::WindingType, wt,
|
||||
__void__setWindingType__C5_WindingType,
|
||||
"Set and get tessellation windong rule. ",
|
||||
"");
|
||||
I_Method0(const osgUtil::Tessellator::WindingType, getWindingType,
|
||||
__C5_WindingType__getWindingType,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, setTessellationType, IN, const osgUtil::Tessellator::TessellationType, tt,
|
||||
__void__setTessellationType__C5_TessellationType,
|
||||
"Set and get tessellation type. ",
|
||||
"");
|
||||
I_Method0(const osgUtil::Tessellator::TessellationType, getTessellationType,
|
||||
__C5_TessellationType__getTessellationType,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, retessellatePolygons, IN, osg::Geometry &, cxgeom,
|
||||
__void__retessellatePolygons__osg_Geometry_R1,
|
||||
"Change the contours lists of the geometry into tessellated primitives (the list of primitives in the original geometry is stored in the Tessellator for possible re-use. ",
|
||||
"The name remains retessellatePolygons although it now handles trifans, strips, quads etc. as well as Polygons so as to not break old codes relying on this function name. ");
|
||||
I_Method1(void, setTessellationNormal, IN, const osg::Vec3, norm,
|
||||
__void__setTessellationNormal__C5_osg_Vec3,
|
||||
"Define the normal to the tessellated polygon - this provides a hint how to tessellate the contours; see gluTessNormal in red book or man pages. ",
|
||||
"GWM July 2005. Can improve teselation \"For example, if you know that all polygons lie in the x-y plane, call gluTessNormal(tess, 0.0, 0.0, 1.0) before rendering any polygons.\"");
|
||||
I_Method0(osg::Geometry::PrimitiveSetList, getContours,
|
||||
__osg_Geometry_PrimitiveSetList__getContours,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, beginTessellation,
|
||||
__void__beginTessellation,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, beginContour,
|
||||
__void__beginContour,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, addVertex, IN, osg::Vec3 *, vertex,
|
||||
__void__addVertex__osg_Vec3_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, endContour,
|
||||
__void__endContour,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, endTessellation,
|
||||
__void__endTessellation,
|
||||
"",
|
||||
"");
|
||||
I_Method0(osgUtil::Tessellator::PrimList &, getPrimList,
|
||||
__PrimList_R1__getPrimList,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, reset,
|
||||
__void__reset,
|
||||
"",
|
||||
"");
|
||||
I_SimpleProperty(const bool, BoundaryOnly,
|
||||
__C5_bool__getBoundaryOnly,
|
||||
__void__setBoundaryOnly__C5_bool);
|
||||
I_SimpleProperty(osg::Geometry::PrimitiveSetList, Contours,
|
||||
__osg_Geometry_PrimitiveSetList__getContours,
|
||||
0);
|
||||
I_SimpleProperty(osgUtil::Tessellator::PrimList &, PrimList,
|
||||
__PrimList_R1__getPrimList,
|
||||
0);
|
||||
I_SimpleProperty(const osg::Vec3, TessellationNormal,
|
||||
0,
|
||||
__void__setTessellationNormal__C5_osg_Vec3);
|
||||
I_SimpleProperty(const osgUtil::Tessellator::TessellationType, TessellationType,
|
||||
__C5_TessellationType__getTessellationType,
|
||||
__void__setTessellationType__C5_TessellationType);
|
||||
I_SimpleProperty(const osgUtil::Tessellator::WindingType, WindingType,
|
||||
__C5_WindingType__getWindingType,
|
||||
__void__setWindingType__C5_WindingType);
|
||||
END_REFLECTOR
|
||||
|
||||
TYPE_NAME_ALIAS(std::vector< osg::Vec3 * >, osgUtil::Tessellator::Prim::VecList);
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osgUtil::Tessellator::Prim)
|
||||
I_BaseType(osg::Referenced);
|
||||
I_Constructor1(IN, GLenum, mode,
|
||||
____Prim__GLenum,
|
||||
"",
|
||||
"");
|
||||
I_PublicMemberProperty(GLenum, _mode);
|
||||
I_PublicMemberProperty(osgUtil::Tessellator::Prim::VecList, _vertices);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_VALUE_REFLECTOR(osg::ref_ptr< osgUtil::Tessellator::Prim >)
|
||||
I_Constructor0(____ref_ptr,
|
||||
"",
|
||||
"");
|
||||
I_Constructor1(IN, osgUtil::Tessellator::Prim *, ptr,
|
||||
____ref_ptr__T_P1,
|
||||
"",
|
||||
"");
|
||||
I_Constructor1(IN, const osg::ref_ptr< osgUtil::Tessellator::Prim > &, rp,
|
||||
____ref_ptr__C5_ref_ptr_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method0(osgUtil::Tessellator::Prim *, get,
|
||||
__T_P1__get,
|
||||
"",
|
||||
"");
|
||||
I_Method0(bool, valid,
|
||||
__bool__valid,
|
||||
"",
|
||||
"");
|
||||
I_Method0(osgUtil::Tessellator::Prim *, release,
|
||||
__T_P1__release,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, swap, IN, osg::ref_ptr< osgUtil::Tessellator::Prim > &, rp,
|
||||
__void__swap__ref_ptr_R1,
|
||||
"",
|
||||
"");
|
||||
I_SimpleProperty(osgUtil::Tessellator::Prim *, ,
|
||||
__T_P1__get,
|
||||
0);
|
||||
END_REFLECTOR
|
||||
|
||||
STD_VECTOR_REFLECTOR(std::vector< osg::Vec3 * >);
|
||||
|
||||
STD_VECTOR_REFLECTOR(std::vector< osg::ref_ptr< osgUtil::Tessellator::Prim > >);
|
||||
|
||||
@@ -84,6 +84,10 @@ BEGIN_OBJECT_REFLECTOR(osgViewer::View)
|
||||
__void__setUpViewAcrossAllScreens,
|
||||
"Convinience method for creating slave Cameras and associated GraphicsWindows across all screens. ",
|
||||
"");
|
||||
I_MethodWithDefaults1(void, setUpViewOnSingleScreen, IN, unsigned int, screenNum, 0,
|
||||
__void__setUpViewOnSingleScreen__unsigned_int,
|
||||
"Convinience method for a single Camara associated with a single full screen GraphicsWindow. ",
|
||||
"");
|
||||
I_Method0(void, requestRedraw,
|
||||
__void__requestRedraw,
|
||||
"requestRedraw() requests a single redraw. ",
|
||||
@@ -112,5 +116,8 @@ BEGIN_OBJECT_REFLECTOR(osgViewer::View)
|
||||
I_SimpleProperty(osg::Node *, SceneData,
|
||||
__osg_Node_P1__getSceneData,
|
||||
__void__setSceneData__osg_Node_P1);
|
||||
I_SimpleProperty(unsigned int, UpViewOnSingleScreen,
|
||||
0,
|
||||
__void__setUpViewOnSingleScreen__unsigned_int);
|
||||
END_REFLECTOR
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <osgIntrospection/Attributes>
|
||||
|
||||
#include <osg/Camera>
|
||||
#include <osg/FrameStamp>
|
||||
#include <osgViewer/Viewer>
|
||||
|
||||
// Must undefine IN and OUT macros defined in Windows headers
|
||||
@@ -52,6 +53,14 @@ BEGIN_OBJECT_REFLECTOR(osgViewer::Viewer)
|
||||
__bool__done,
|
||||
"",
|
||||
"");
|
||||
I_Method0(osg::FrameStamp *, getFrameStamp,
|
||||
__osg_FrameStamp_P1__getFrameStamp,
|
||||
"",
|
||||
"");
|
||||
I_Method0(const osg::FrameStamp *, getFrameStamp,
|
||||
__C5_osg_FrameStamp_P1__getFrameStamp,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, setThreadingModel, IN, osgViewer::Viewer::ThreadingModel, threadingModel,
|
||||
__void__setThreadingModel__ThreadingModel,
|
||||
"Set the threading model the rendering traversals will use. ",
|
||||
@@ -126,6 +135,9 @@ BEGIN_OBJECT_REFLECTOR(osgViewer::Viewer)
|
||||
I_SimpleProperty(bool, Done,
|
||||
0,
|
||||
__void__setDone__bool);
|
||||
I_SimpleProperty(osg::FrameStamp *, FrameStamp,
|
||||
__osg_FrameStamp_P1__getFrameStamp,
|
||||
0);
|
||||
I_SimpleProperty(int, KeySetsDone,
|
||||
__int__getKeySetsDone,
|
||||
__void__setKeySetsDone__int);
|
||||
|
||||
Reference in New Issue
Block a user