Hi,
Gerrit Voss wrote:
On Sun, 2008-06-15 at 10:30 -0500, Carsten Neumann wrote:
What happens to the loader in case of Node as this one also
includes a dynamic volume (IIRC)
for Nodes the volume is neither written nor loaded; there is code in the
loaders (1.x and 2) that explicitly excludes it.
hmm, for all loaders/writers ?, because the field itself is not marked
internal. I'll do that so we are going to be on the save side.
this can only affect osb and osg, right? The other loader/writer should
follow what ever format they read/write and just need to create the
correct (or closest possible) OpenSG representation of that.
Just to be clear, I did not take any actions to preserve compatibility
for osg, but AFAIK nobody else has done so in the past either ;)
Strictly speaking it might be an error not to write the volume, at least
for cases where it was marked as static by the user we loose this
information. On the other hand that is a very rare case and osb never
contained information about the volume so marking it internal should at
least improve consistency.
This seems to me the bigger issue and reason for solution 1 as compared
to the relatively unused proxy group. So still I would prefer to make
3 possible.
ok, I'll continue working on the patch then.
... and here it is, compiled enable-osg2-prep/disable-osg2-prep. Please
apply when convenient
Thanks,
Carsten
Index: Source/Base/Base/OSGVolumeFunctions.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/Base/Base/OSGVolumeFunctions.cpp,v
retrieving revision 1.9
diff -u -r1.9 OSGVolumeFunctions.cpp
--- Source/Base/Base/OSGVolumeFunctions.cpp 2 Oct 2005 15:26:15 -0000 1.9
+++ Source/Base/Base/OSGVolumeFunctions.cpp 17 Jun 2008 16:28:38 -0000
@@ -54,8 +54,12 @@
{
bool retCode = false;
+#ifndef OSG_2_PREP
const DynamicVolume *dv = dynamic_cast<const DynamicVolume *>(&vol1);
const Volume *v = dv ? &(dv->getInstance()) : &vol1;
+#else
+ const Volume *v = &vol1;
+#endif
const BoxVolume *bv;
const SphereVolume *sv;
const CylinderVolume *cv;
@@ -276,8 +280,12 @@
{
bool retCode = false;
- const DynamicVolume *dv = dynamic_cast<const DynamicVolume *>(&vol);
- const Volume *v = dv ? &(dv->getInstance()) : &vol;
+#ifndef OSG_2_PREP
+ const DynamicVolume *dv = dynamic_cast<const DynamicVolume *>(&vol);
+ const Volume *v = dv ? &(dv->getInstance()) : &vol;
+#else
+ const Volume *v = &vol;
+#endif
const BoxVolume *bv;
const SphereVolume *sv;
const CylinderVolume *cv;
@@ -420,8 +428,12 @@
{
bool retCode = false;
- const DynamicVolume *dv = dynamic_cast<const DynamicVolume *>(&vol);
- const Volume *v = dv ? &(dv->getInstance()) : &vol;
+#ifndef OSG_2_PREP
+ const DynamicVolume *dv = dynamic_cast<const DynamicVolume *>(&vol);
+ const Volume *v = dv ? &(dv->getInstance()) : &vol;
+#else
+ const Volume *v = &vol;
+#endif
const BoxVolume *bv;
const SphereVolume *sv;
const CylinderVolume *cv;
@@ -584,8 +596,12 @@
{
bool retCode = false;
- const DynamicVolume *dv = dynamic_cast<const DynamicVolume *>(&vol);
- const Volume *v = dv ? &(dv->getInstance()) : &vol;
+#ifndef OSG_2_PREP
+ const DynamicVolume *dv = dynamic_cast<const DynamicVolume *>(&vol);
+ const Volume *v = dv ? &(dv->getInstance()) : &vol;
+#else
+ const Volume *v = &vol;
+#endif
const BoxVolume *bv;
const SphereVolume *sv;
const CylinderVolume *cv;
@@ -627,8 +643,12 @@
{
bool retCode = false;
+#ifndef OSG_2_PREP
const DynamicVolume *dv = dynamic_cast<const DynamicVolume *>(&vol);
const Volume *v = dv ? &(dv->getInstance()) : &vol;
+#else
+ const Volume *v = &vol;
+#endif
const BoxVolume *bv;
const SphereVolume *sv;
const CylinderVolume *cv;
@@ -833,12 +853,15 @@
{
const Volume *v = &vol;
const BoxVolume *box;
+
+#ifndef OSG_2_PREP
const DynamicVolume *dynamic = dynamic_cast<const DynamicVolume *>(v);
if(dynamic)
{
v = &(dynamic->getInstance());
}
+#endif
if((box = dynamic_cast<const BoxVolume *>(v)))
{
@@ -1060,12 +1083,15 @@
{
const Volume *v = &vol;
const SphereVolume *sphere;
+
+#ifndef OSG_2_PREP
const DynamicVolume *dynamic = dynamic_cast<const DynamicVolume *>(v);
if(dynamic)
{
v = &(dynamic->getInstance());
}
+#endif
if((sphere = dynamic_cast<const SphereVolume *>(v)) != NULL)
{
@@ -1302,12 +1328,15 @@
{
const Volume *v = &vol;
const CylinderVolume *cylinder;
+
+#ifndef OSG_2_PREP
const DynamicVolume *dynamic = dynamic_cast<const DynamicVolume *>(v);
if(dynamic)
{
v = &(dynamic->getInstance());
}
+#endif
if((cylinder = dynamic_cast<const CylinderVolume *>(v)) != NULL)
{
Index: Source/Base/Field/OSGBaseFieldDataType.h
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/Base/Field/OSGBaseFieldDataType.h,v
retrieving revision 1.15
diff -u -r1.15 OSGBaseFieldDataType.h
--- Source/Base/Field/OSGBaseFieldDataType.h 5 Jun 2008 04:59:06 -0000 1.15
+++ Source/Base/Field/OSGBaseFieldDataType.h 17 Jun 2008 16:28:38 -0000
@@ -915,6 +915,186 @@
/*! \hideinhierarchy */
#endif
+template <>
+struct OSG_BASE_DLLMAPPING FieldDataTraits<BoxVolume> :
+ public FieldTraitsRecurseBase<BoxVolume>
+{
+ private:
+
+ static DataType _type;
+
+ public:
+
+ typedef FieldDataTraits<BoxVolume> Self;
+
+ enum { StringConvertable = ToStringConvertable |
+ FromStringConvertable };
+
+ static OSG_BASE_DLLMAPPING
+ DataType &getType (void);
+
+ static const Char8 *getSName (void) { return "SFBoxVolume"; }
+
+ static const Char8 *getMName (void) { return "MFBoxVolume"; }
+
+ static const BoxVolume getDefault (void) { return BoxVolume(); }
+
+
+ static bool getFromString( BoxVolume &outVal,
+ const Char8 *&inVal)
+ {
+ Real32 valStore[ 6];
+ Char8 str [256];
+
+ UInt32 length = strlen(inVal);
+ Char8 *c = str;
+
+ if(length > 256)
+ {
+ std::cerr << "FieldDataTraits<BoxVolume>::getFromString(): "
+ << "Input too long" << std::endl;
+
+ return false;
+ }
+
+ strncpy(str, inVal, length);
+
+ while(*c != '\0')
+ {
+ if(*c == '[')
+ *c = ' ';
+ if(*c == ']')
+ *c = ' ';
+ if(*c == ',')
+ *c = ' ';
+
+ c++;
+ }
+
+ Int16 count = sscanf(str, "%f %f %f %f %f %f",
+ &valStore[0],
+ &valStore[1],
+ &valStore[2],
+ &valStore[3],
+ &valStore[4],
+ &valStore[5]);
+
+ if(count == 6)
+ {
+ outVal.setBounds(valStore[0],
+ valStore[1],
+ valStore[2],
+ valStore[3],
+ valStore[4],
+ valStore[5]);
+
+ return true;
+ }
+ else
+ {
+ outVal.setBounds(0.f, 0.f, 0.f,
+ 0.f, 0.f, 0.f);
+
+ return false;
+ }
+ }
+
+ static void putToString(const BoxVolume &val,
+ std::string &outStr)
+ {
+ Pnt3f min, max;
+
+ typedef TypeTraits<Pnt3f::ValueType> TypeTrait;
+
+ val.getBounds(min, max);
+ outStr.append(TypeTrait::putToString(min.getValues()[0]));
+ outStr.append(" ");
+ outStr.append(TypeTrait::putToString(min.getValues()[1]));
+ outStr.append(" ");
+ outStr.append(TypeTrait::putToString(min.getValues()[2]));
+ outStr.append(" ");
+ outStr.append(TypeTrait::putToString(max.getValues()[0]));
+ outStr.append(" ");
+ outStr.append(TypeTrait::putToString(max.getValues()[1]));
+ outStr.append(" ");
+ outStr.append(TypeTrait::putToString(max.getValues()[2]));
+ }
+
+ static UInt32 getBinSize(const BoxVolume &oObject)
+ {
+ UInt32 size = sizeof(UInt16);
+
+ size += sizeof(Pnt3f) + sizeof(Pnt3f);
+
+ return size;
+ }
+
+
+ static UInt32 getBinSize(const BoxVolume *pObjectStore,
+ UInt32 uiNumObjects)
+ {
+ UInt32 size = 0;
+
+ for(UInt32 i = 0; i < uiNumObjects; ++i)
+ {
+ size += getBinSize(pObjectStore[i]);
+ }
+
+ return size;
+ }
+
+ static void copyToBin( BinaryDataHandler &pMem,
+ const BoxVolume &oObject)
+ {
+
+ UInt16 state = oObject.getState();
+
+ pMem.putValue(state);
+
+ pMem.putValues(&(oObject.getMin()[0]), 3);
+ pMem.putValues(&(oObject.getMax()[0]), 3);
+ }
+
+ static void copyToBin( BinaryDataHandler &pMem,
+ const BoxVolume *pObjectStore,
+ UInt32 uiNumObjects)
+ {
+ for(UInt32 i = 0; i < uiNumObjects; ++i)
+ {
+ copyToBin(pMem, pObjectStore[i]);
+ }
+ }
+
+ static void copyFromBin(BinaryDataHandler &pMem,
+ BoxVolume &oObject)
+ {
+ Pnt3f min,max;
+ UInt16 state;
+
+ pMem.getValue (state );
+ pMem.getValues(&(min[0]), 3);
+ pMem.getValues(&(max[0]), 3);
+
+ oObject.setBounds(min, max);
+ oObject.setState (state );
+ }
+
+ static void copyFromBin(BinaryDataHandler &pMem,
+ BoxVolume *pObjectStore,
+ UInt32 uiNumObjects)
+ {
+ for(UInt32 i = 0; i < uiNumObjects; ++i)
+ {
+ copyFromBin(pMem, pObjectStore[i]);
+ }
+ }
+};
+
+#if !defined(OSG_DOC_DEV_TRAITS)
+/*! \class FieldTraitsTemplateBase<BoxVolume> */
+/*! \hideinhierarchy */
+#endif
+
/*! \ingroup GrpBaseFieldTraits
*/
#if !defined(OSG_DOC_DEV_TRAITS)
Index: Source/Base/Field/OSGMFBaseTypes.h
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/Base/Field/OSGMFBaseTypes.h,v
retrieving revision 1.7
diff -u -r1.7 OSGMFBaseTypes.h
--- Source/Base/Field/OSGMFBaseTypes.h 14 Mar 2003 17:23:52 -0000 1.7
+++ Source/Base/Field/OSGMFBaseTypes.h 17 Jun 2008 16:28:38 -0000
@@ -124,7 +124,6 @@
OSG_DLLEXPORT_DECL1(MField, Color4ub, OSG_BASE_DLLTMPLMAPPING)
#endif
-
#if !defined(OSG_DO_DOC) || defined(OSG_DOC_FIELD_TYPEDEFS)
/*! \ingroup GrpBaseFieldMulti */
@@ -139,6 +138,16 @@
#if !defined(OSG_DO_DOC) || defined(OSG_DOC_FIELD_TYPEDEFS)
/*! \ingroup GrpBaseFieldMulti */
+typedef MField<BoxVolume> MFBoxVolume;
+#endif
+
+#ifndef OSG_COMPILEFIELDINST
+OSG_DLLEXPORT_DECL1(MField, BoxVolume, OSG_BASE_DLLTMPLMAPPING)
+#endif
+
+#if !defined(OSG_DO_DOC) || defined(OSG_DOC_FIELD_TYPEDEFS)
+/*! \ingroup GrpBaseFieldMulti */
+
typedef MField<BitVector, 1> MFBitVector;
#endif
Index: Source/Base/Field/OSGSFBaseTypes.h
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/Base/Field/OSGSFBaseTypes.h,v
retrieving revision 1.7
diff -u -r1.7 OSGSFBaseTypes.h
--- Source/Base/Field/OSGSFBaseTypes.h 14 Mar 2003 17:23:52 -0000 1.7
+++ Source/Base/Field/OSGSFBaseTypes.h 17 Jun 2008 16:28:38 -0000
@@ -132,6 +132,16 @@
OSG_DLLEXPORT_DECL1(SField, DynamicVolume, OSG_BASE_DLLTMPLMAPPING)
#endif
+#if !defined(OSG_DO_DOC) || defined(OSG_DOC_FIELD_TYPEDEFS)
+/*! \ingroup GrpBaseFieldSingle */
+
+typedef SField<BoxVolume> SFBoxVolume;
+#endif
+
+#ifndef OSG_COMPILEFIELDINST
+OSG_DLLEXPORT_DECL1(SField, BoxVolume, OSG_BASE_DLLTMPLMAPPING)
+#endif
+
#if !defined(OSG_DO_DOC) || defined(OSG_DOC_FIELD_TYPEDEFS)
/*! \ingroup GrpBaseFieldSingle */
Index: Source/Base/Field/OSGTypeInst.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/Base/Field/OSGTypeInst.cpp,v
retrieving revision 1.10
diff -u -r1.10 OSGTypeInst.cpp
--- Source/Base/Field/OSGTypeInst.cpp 12 Mar 2006 13:44:04 -0000 1.10
+++ Source/Base/Field/OSGTypeInst.cpp 17 Jun 2008 16:28:38 -0000
@@ -92,6 +92,8 @@
"BaseType");
DataType FieldDataTraits<DynamicVolume>::_type("DynamicVolume",
"BaseType");
+DataType FieldDataTraits<BoxVolume >::_type("BoxVolume",
+ "BaseType");
DataType FieldDataTraits1<BitVector >::_type("BitVector",
"BaseType");
DataType FieldDataTraits1<GLenum >::_type("GLenum",
@@ -193,6 +195,7 @@
OSG_DLLEXPORT_SFIELD_DEF1(Color3ub, OSG_BASE_DLLTMPLMAPPING);
OSG_DLLEXPORT_SFIELD_DEF1(Color4ub, OSG_BASE_DLLTMPLMAPPING);
OSG_DLLEXPORT_SFIELD_DEF1(DynamicVolume, OSG_BASE_DLLTMPLMAPPING);
+OSG_DLLEXPORT_SFIELD_DEF1(BoxVolume, OSG_BASE_DLLTMPLMAPPING);
OSG_DLLEXPORT_SFIELD_DEF2(BitVector, 1, OSG_BASE_DLLTMPLMAPPING);
OSG_DLLEXPORT_SFIELD_DEF2(GLenum, 1, OSG_BASE_DLLTMPLMAPPING);
@@ -203,6 +206,7 @@
OSG_DLLEXPORT_MFIELD_DEF1(Color3ub, OSG_BASE_DLLTMPLMAPPING);
OSG_DLLEXPORT_MFIELD_DEF1(Color4ub, OSG_BASE_DLLTMPLMAPPING);
OSG_DLLEXPORT_MFIELD_DEF1(DynamicVolume, OSG_BASE_DLLTMPLMAPPING);
+OSG_DLLEXPORT_MFIELD_DEF1(BoxVolume, OSG_BASE_DLLTMPLMAPPING);
OSG_DLLEXPORT_MFIELD_DEF2(BitVector, 1, OSG_BASE_DLLTMPLMAPPING);
OSG_DLLEXPORT_MFIELD_DEF2(GLenum, 1, OSG_BASE_DLLTMPLMAPPING);
Index: Source/Experimental/NewAction/Actors/OSGIntersectActor.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/Experimental/NewAction/Actors/OSGIntersectActor.cpp,v
retrieving revision 1.6
diff -u -r1.6 OSGIntersectActor.cpp
--- Source/Experimental/NewAction/Actors/OSGIntersectActor.cpp 11 Jun 2008 11:28:53 -0000 1.6
+++ Source/Experimental/NewAction/Actors/OSGIntersectActor.cpp 17 Jun 2008 16:28:38 -0000
@@ -136,10 +136,14 @@
for(UInt32 i = 0; i < numChildren; ++i)
{
- const DynamicVolume &dynVol = getChild(i)->editVolume(true);
+#ifndef OSG_2_PREP
+ const DynamicVolume &vol = getChild(i)->editVolume(true);
+#else
+ const BoxVolume &vol = getChild(i)->editVolume(true);
+#endif
- if((dynVol.intersect(getRay(), bvEnter, bvExit) == true ) &&
- (bvEnter * scaleFactor < hitDist) )
+ if((vol.intersect(getRay(), bvEnter, bvExit) == true ) &&
+ (bvEnter * scaleFactor < hitDist) )
{
setChildPriority(i, -bvEnter * scaleFactor);
}
@@ -151,10 +155,14 @@
for(UInt32 i = 0; i < numExtraChildren; ++i)
{
- const DynamicVolume &dynVol = getExtraChild(i)->editVolume(true);
+#ifndef OSG_2_PREP
+ const DynamicVolume &vol = getChild(i)->editVolume(true);
+#else
+ const BoxVolume &vol = getChild(i)->editVolume(true);
+#endif
- if((dynVol.intersect(getRay(), bvEnter, bvExit) == true ) &&
- (bvEnter * scaleFactor < hitDist) )
+ if((vol.intersect(getRay(), bvEnter, bvExit) == true ) &&
+ (bvEnter * scaleFactor < hitDist) )
{
setExtraChildPriority(i, -bvEnter * scaleFactor);
}
Index: Source/Experimental/ShadowViewport/OSGShadowViewport.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/Experimental/ShadowViewport/OSGShadowViewport.cpp,v
retrieving revision 1.35
diff -u -r1.35 OSGShadowViewport.cpp
--- Source/Experimental/ShadowViewport/OSGShadowViewport.cpp 11 Jun 2008 11:28:53 -0000 1.35
+++ Source/Experimental/ShadowViewport/OSGShadowViewport.cpp 17 Jun 2008 16:28:39 -0000
@@ -1417,7 +1417,11 @@
ract->getViewport()->getPixelHeight());
}
+#ifndef OSG_2_PREP
DynamicVolume vol = node->getVolume();
+#else
+ BoxVolume vol = node->getVolume();
+#endif
Matrix m = view;
if(node->getParent() != NullFC)
m.mult(node->getParent()->getToWorld());
@@ -1432,7 +1436,11 @@
if(ract->_occlusionQuery == 0)
ract->_glGenQueriesARB(1, &ract->_occlusionQuery);
+#ifndef OSG_2_PREP
const DynamicVolume& vol = node->getVolume();
+#else
+ const BoxVolume & vol = node->getVolume();
+#endif
Pnt3f min,max;
vol.getBounds(min, max);
Index: Source/System/Action/DrawAction/OSGDrawAction.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/Action/DrawAction/OSGDrawAction.cpp,v
retrieving revision 1.5
diff -u -r1.5 OSGDrawAction.cpp
--- Source/System/Action/DrawAction/OSGDrawAction.cpp 11 Jul 2005 22:10:36 -0000 1.5
+++ Source/System/Action/DrawAction/OSGDrawAction.cpp 17 Jun 2008 16:28:39 -0000
@@ -230,7 +230,11 @@
getStatistics()->getElem(statCullTestedNodes)->inc();
+#ifndef OSG_2_PREP
DynamicVolume vol;
+#else
+ BoxVolume vol;
+#endif
node->getWorldVolume( vol );
if ( _frustum.intersect( vol ) )
Index: Source/System/Action/RenderAction/OSGRenderAction.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/Action/RenderAction/OSGRenderAction.cpp,v
retrieving revision 1.118
diff -u -r1.118 OSGRenderAction.cpp
--- Source/System/Action/RenderAction/OSGRenderAction.cpp 11 Jun 2008 11:28:54 -0000 1.118
+++ Source/System/Action/RenderAction/OSGRenderAction.cpp 17 Jun 2008 16:28:39 -0000
@@ -863,7 +863,11 @@
// we don't want the center we use the front most
// z value for the sorting.
+#ifndef OSG_2_PREP
DynamicVolume vol = getActNode()->getVolume();
+#else
+ BoxVolume vol = getActNode()->getVolume();
+#endif
vol.transform(_currMatrix.second);
objPos = vol.getMax();
@@ -1375,7 +1379,11 @@
getStatistics()->getElem(statCullTestedNodes)->inc();
+#ifndef OSG_2_PREP
DynamicVolume vol;
+#else
+ BoxVolume vol;
+#endif
// node->getWorldVolume( vol );
@@ -1423,7 +1431,11 @@
NodePtr node = getActNode();
+#ifndef OSG_2_PREP
DynamicVolume vol = node->editVolume(true);
+#else
+ BoxVolume vol = node->editVolume(true);
+#endif
FrustumVolume frustum = _frustum;
#if 1
@@ -1626,7 +1638,11 @@
return false;
//node->updateVolume();
+#ifndef OSG_2_PREP
DynamicVolume vol = node->getVolume();
+#else
+ BoxVolume vol = node->getVolume();
+#endif
vol.transform(top_matrix());
Pnt3f p[8];
@@ -1766,7 +1782,11 @@
if(_occlusionQuery == 0)
_glGenQueriesARB(1, &_occlusionQuery);
- const DynamicVolume& vol = pRoot->getNode()->getVolume();
+#ifndef OSG_2_PREP
+ const DynamicVolume &vol = pRoot->getNode()->getVolume();
+#else
+ const BoxVolume &vol = pRoot->getNode()->getVolume();
+#endif
Pnt3f min,max;
vol.getBounds(min, max);
@@ -2021,7 +2041,11 @@
if(_glGenQueriesARB != NULL && ((pos_size > _occlusionCullingThreshold) ||
(_occlusionCullingMode == OcclusionHierarchicalMultiFrame)))
{
+#ifndef OSG_2_PREP
DynamicVolume vol = pRoot->getNode()->getVolume();
+#else
+ BoxVolume vol = pRoot->getNode()->getVolume();
+#endif
vol.transform(pRoot->getMatrixStore().second);
// ignore objects behind the camera.
if(vol.getMax()[2] < 0.0f)
@@ -2070,7 +2094,11 @@
if(node == NullFC || _glGenQueriesARB == NULL)
return;
+#ifndef OSG_2_PREP
DynamicVolume vol = node->getVolume();
+#else
+ BoxVolume vol = node->getVolume();
+#endif
Matrix m = view;
if(node->getParent() != NullFC)
m.mult(node->getParent()->getToWorld());
Index: Source/System/Cluster/Window/BalancedMultiWindow/OSGBalancedMultiWindow.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/Cluster/Window/BalancedMultiWindow/OSGBalancedMultiWindow.cpp,v
retrieving revision 1.18
diff -u -r1.18 OSGBalancedMultiWindow.cpp
--- Source/System/Cluster/Window/BalancedMultiWindow/OSGBalancedMultiWindow.cpp 13 Jun 2008 04:59:47 -0000 1.18
+++ Source/System/Cluster/Window/BalancedMultiWindow/OSGBalancedMultiWindow.cpp 17 Jun 2008 16:28:40 -0000
@@ -527,7 +527,11 @@
Int32 bit = 1;
// get local volume
- DynamicVolume volume = group.node->getVolume();
+#ifndef OSG_2_PREP
+ const DynamicVolume &volume = group.node->getVolume();
+#else
+ const BoxVolume &volume = group.node->getVolume();
+#endif
#else
Matrix trans = proj;
Index: Source/System/Cluster/Window/Base/OSGImageComposer.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/Cluster/Window/Base/OSGImageComposer.cpp,v
retrieving revision 1.5
diff -u -r1.5 OSGImageComposer.cpp
--- Source/System/Cluster/Window/Base/OSGImageComposer.cpp 11 Jun 2008 11:28:54 -0000 1.5
+++ Source/System/Cluster/Window/Base/OSGImageComposer.cpp 17 Jun 2008 16:28:40 -0000
@@ -212,7 +212,11 @@
m.multLeft(viewing);
// get transformed volume
node->updateVolume();
- DynamicVolume volume=node->getVolume();
+#ifndef OSG_2_PREP
+ DynamicVolume volume = node->getVolume();
+#else
+ BoxVolume volume = node->getVolume();
+#endif
// bug in osg base
/*
if(volume.isEmpty())
Index: Source/System/Cluster/Window/SortFirst/OSGTileGeometryLoad.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/Cluster/Window/SortFirst/OSGTileGeometryLoad.cpp,v
retrieving revision 1.15
diff -u -r1.15 OSGTileGeometryLoad.cpp
--- Source/System/Cluster/Window/SortFirst/OSGTileGeometryLoad.cpp 11 Jun 2008 11:28:54 -0000 1.15
+++ Source/System/Cluster/Window/SortFirst/OSGTileGeometryLoad.cpp 17 Jun 2008 16:28:40 -0000
@@ -162,7 +162,11 @@
m.multLeft(viewing);
// get transformed volume
node->updateVolume();
- DynamicVolume volume=node->getVolume();
+#ifndef OSG_2_PREP
+ DynamicVolume volume = node->getVolume();
+#else
+ BoxVolume volume = node->getVolume();
+#endif
// bug in osg base
/*
if(volume.isEmpty())
@@ -306,7 +310,7 @@
if(node == NullFC)
return;
- const OSG::Volume *volume = &(node->getVolume().getInstance());
+ const OSG::Volume &volume = node->getVolume();
TriangleIterator f;
int p,s;
Vec3f vmin,vmax;
@@ -327,7 +331,7 @@
return;
// get volume min,max
- volume->getBounds(vmin,vmax);
+ volume.getBounds(vmin,vmax);
// count faces
for(f=geo->beginTriangles() ; f!=geo->endTriangles() ; ++f)
Index: Source/System/Cluster/Window/SortLast/OSGSortLastWindow.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/Cluster/Window/SortLast/OSGSortLastWindow.cpp,v
retrieving revision 1.14
diff -u -r1.14 OSGSortLastWindow.cpp
--- Source/System/Cluster/Window/SortLast/OSGSortLastWindow.cpp 13 Jun 2008 04:59:47 -0000 1.14
+++ Source/System/Cluster/Window/SortLast/OSGSortLastWindow.cpp 17 Jun 2008 16:28:40 -0000
@@ -463,7 +463,11 @@
drawableInfo.node = node;
// get transformed volume
node->updateVolume();
+#ifndef OSG_2_PREP
DynamicVolume volume;
+#else
+ BoxVolume volume;
+#endif
node->getWorldVolume(volume);
// get min,max
volume.getBounds(drawableInfo.bMin, drawableInfo.bMax);
@@ -485,7 +489,11 @@
drawableInfo.node = node;
// get transformed volume
node->updateVolume();
+#ifndef OSG_2_PREP
DynamicVolume volume;
+#else
+ BoxVolume volume;
+#endif
node->getWorldVolume(volume);
// get min,max
volume.getBounds(drawableInfo.bMin, drawableInfo.bMax);
Index: Source/System/FieldContainer/OSGNode.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/FieldContainer/OSGNode.cpp,v
retrieving revision 1.35
diff -u -r1.35 OSGNode.cpp
--- Source/System/FieldContainer/OSGNode.cpp 13 Jun 2008 04:59:47 -0000 1.35
+++ Source/System/FieldContainer/OSGNode.cpp 17 Jun 2008 16:28:40 -0000
@@ -71,12 +71,21 @@
FieldDescription *Node::_desc[] =
{
+#ifndef OSG_2_PREP
new FieldDescription(SFDynamicVolume::getClassType(),
"volume",
OSG_FC_FIELD_IDM_DESC(VolumeField),
false,
reinterpret_cast<FieldAccessMethod>(
&Node::editSFVolume)),
+#else
+ new FieldDescription(SFBoxVolume::getClassType(),
+ "volume",
+ OSG_FC_FIELD_IDM_DESC(VolumeField),
+ false,
+ reinterpret_cast<FieldAccessMethod>(
+ &Node::editSFVolume)),
+#endif
// Yes, this is wrong, it should be an UInt32, but changing
// it now will break all old .osb files, and this info is
@@ -423,7 +432,11 @@
/*-------------------------------------------------------------------------*/
/* Volume */
+#ifndef OSG_2_PREP
void Node::getWorldVolume(DynamicVolume &result)
+#else
+void Node::getWorldVolume(BoxVolume &result)
+#endif
{
Matrix m;
@@ -452,6 +465,7 @@
void Node::updateVolume(void)
{
+#ifndef OSG_2_PREP
if(_sfVolume.getValue().getInstance().isValid() == true ||
getTravMask() == 0x0000)
{
@@ -460,7 +474,6 @@
// be careful to not change the real volume. If two threads
// are updating the same aspect this will lead to chaos
-
DynamicVolume vol = _sfVolume.getValue();
//fprintf(stderr,"%p: node 0x%p update needed\n", Thread::getCurrent(), this);
@@ -491,11 +504,55 @@
_sfVolume.setValue(vol);
endEditCP(thisP, VolumeFieldMask);
+
+#else
+
+ if(_sfVolume.getValue().isValid() == true ||
+ getTravMask() == 0x0000)
+ {
+ return; // still valid, nothing to do
+ }
+
+ // be careful to not change the real volume. If two threads
+ // are updating the same aspect this will lead to chaos
+ BoxVolume vol = _sfVolume.getValue();
+
+//fprintf(stderr,"%p: node 0x%p update needed\n", Thread::getCurrent(), this);
+
+ MFNodePtr::iterator it;
+
+ vol.setEmpty();
+
+ for(it = _mfChildren.begin(); it != _mfChildren.end(); ++it)
+ {
+ if(*it != NullFC && (*it)->getTravMask())
+ {
+ (*it)->updateVolume();
+ vol.extendBy((*it)->getVolume());
+ }
+ }
+
+ // test for null core. Shouldn't happen, but just in case...
+ if(getCore() != NullFC)
+ getCore()->adjustVolume(vol);
+
+ NodePtr thisP = getPtr();
+
+ beginEditCP(thisP, VolumeFieldMask);
+
+ _sfVolume.setValue(vol);
+
+ endEditCP(thisP, VolumeFieldMask);
+#endif // OSG_2_PREP
}
void Node::invalidateVolume(void)
{
- Volume &vol=_sfVolume.getValue().getInstance();
+#ifndef OSG_2_PREP
+ Volume &vol = _sfVolume.getValue().getInstance();
+#else
+ Volume &vol = _sfVolume.getValue();
+#endif
if(vol.isValid() == true && vol.isStatic() == false)
{
@@ -504,7 +561,9 @@
beginEditCP(thisP, VolumeFieldMask);
vol.setValid(false);
+#ifndef OSG_2_PREP
_sfVolume.getValue().instanceChanged();
+#endif
endEditCP(thisP, VolumeFieldMask);
Index: Source/System/FieldContainer/Impl/OSGNodeImpl.h
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/FieldContainer/Impl/OSGNodeImpl.h,v
retrieving revision 1.16
diff -u -r1.16 OSGNodeImpl.h
--- Source/System/FieldContainer/Impl/OSGNodeImpl.h 13 Jun 2008 04:59:47 -0000 1.16
+++ Source/System/FieldContainer/Impl/OSGNodeImpl.h 17 Jun 2008 16:28:40 -0000
@@ -177,8 +177,13 @@
/*! \name Access Fields */
/*! \{ */
+#ifndef OSG_2_PREP
const SFDynamicVolume *getSFVolume (void) const;
SFDynamicVolume *editSFVolume (void);
+#else
+ const SFBoxVolume *getSFVolume (void) const;
+ SFBoxVolume *editSFVolume (void);
+#endif
const SFUInt32 *getSFTravMask(void) const;
SFUInt32 *editSFTravMask(void);
@@ -218,10 +223,19 @@
DynamicVolume &getVolume (bool update );
#endif
+#ifndef OSG_2_PREP
DynamicVolume &editVolume (bool update );
const DynamicVolume &getVolume (void ) const;
+#else
+ BoxVolume &editVolume (bool update );
+ const BoxVolume &getVolume (void ) const;
+#endif
+#ifndef OSG_2_PREP
void getWorldVolume (DynamicVolume &result);
+#else
+ void getWorldVolume (BoxVolume &result);
+#endif
void updateVolume (void );
@@ -277,7 +291,11 @@
/*! \name Fields */
/*! \{ */
+#ifndef OSG_2_PREP
SFDynamicVolume _sfVolume;
+#else
+ SFBoxVolume _sfVolume;
+#endif
SFUInt32 _sfTravMask;
Index: Source/System/FieldContainer/Impl/OSGNodeImpl.inl
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/FieldContainer/Impl/OSGNodeImpl.inl,v
retrieving revision 1.16
diff -u -r1.16 OSGNodeImpl.inl
--- Source/System/FieldContainer/Impl/OSGNodeImpl.inl 13 Jun 2008 04:59:47 -0000 1.16
+++ Source/System/FieldContainer/Impl/OSGNodeImpl.inl 17 Jun 2008 16:28:40 -0000
@@ -53,11 +53,19 @@
/*-------------------------------------------------------------------------*/
/* Get */
+#ifndef OSG_2_PREP
inline
const DynamicVolume &Node::getVolume(void) const
{
return _sfVolume.getValue();
}
+#else
+inline
+const BoxVolume &Node::getVolume(void) const
+{
+ return _sfVolume.getValue();
+}
+#endif
#ifndef OSG_2_PREP
inline
@@ -70,6 +78,7 @@
}
#endif
+#ifndef OSG_2_PREP
inline
DynamicVolume &Node::editVolume(bool update)
{
@@ -78,6 +87,16 @@
return _sfVolume.getValue();
}
+#else
+inline
+BoxVolume &Node::editVolume(bool update)
+{
+ if(update == true)
+ updateVolume();
+
+ return _sfVolume.getValue();
+}
+#endif
inline
NodePtr Node::getParent(void)
@@ -140,6 +159,7 @@
/*-------------------------------------------------------------------------*/
/* Access Fields */
+#ifndef OSG_2_PREP
inline
const SFDynamicVolume *Node::getSFVolume(void) const
{
@@ -151,6 +171,19 @@
{
return &_sfVolume;
}
+#else
+inline
+const SFBoxVolume *Node::getSFVolume(void) const
+{
+ return &_sfVolume;
+}
+
+inline
+SFBoxVolume *Node::editSFVolume(void)
+{
+ return &_sfVolume;
+}
+#endif
#ifndef OSG_2_PREP
inline
Index: Source/System/FileIO/ScanParseSkel/OSGScanParseSkel.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/FileIO/ScanParseSkel/OSGScanParseSkel.cpp,v
retrieving revision 1.19
diff -u -r1.19 OSGScanParseSkel.cpp
--- Source/System/FileIO/ScanParseSkel/OSGScanParseSkel.cpp 9 Jun 2008 07:30:37 -0000 1.19
+++ Source/System/FileIO/ScanParseSkel/OSGScanParseSkel.cpp 17 Jun 2008 16:28:40 -0000
@@ -491,10 +491,17 @@
addFieldValue(_tmpString1.c_str());
}
+#ifndef OSG_2_PREP
void ScanParseSkel::addVolumeValue(const DynamicVolume &v)
{
addFieldValue(_tmpString1.c_str());
}
+#else
+void ScanParseSkel::addVolumeValue(const BoxVolume &v)
+{
+ addFieldValue(_tmpString1.c_str());
+}
+#endif
void ScanParseSkel::addRoute(const Char8 *,
const Char8 *,
Index: Source/System/FileIO/ScanParseSkel/OSGScanParseSkel.h
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/FileIO/ScanParseSkel/OSGScanParseSkel.h,v
retrieving revision 1.18
diff -u -r1.18 OSGScanParseSkel.h
--- Source/System/FileIO/ScanParseSkel/OSGScanParseSkel.h 28 Aug 2007 15:15:07 -0000 1.18
+++ Source/System/FileIO/ScanParseSkel/OSGScanParseSkel.h 17 Jun 2008 16:28:40 -0000
@@ -316,7 +316,11 @@
virtual void addPlaneValue(const Plane &p);
+#ifndef OSG_2_PREP
virtual void addVolumeValue(const DynamicVolume &v);
+#else
+ virtual void addVolumeValue(const BoxVolume &v);
+#endif
virtual void addRoute (const Char8 *szOutNodename,
const Char8 *szOutFieldname,
Index: Source/System/FileIO/ScanParseSkel/OSGScanParseSkel.y
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/FileIO/ScanParseSkel/OSGScanParseSkel.y,v
retrieving revision 1.30
diff -u -r1.30 OSGScanParseSkel.y
--- Source/System/FileIO/ScanParseSkel/OSGScanParseSkel.y 11 May 2007 16:46:58 -0000 1.30
+++ Source/System/FileIO/ScanParseSkel/OSGScanParseSkel.y 17 Jun 2008 16:28:41 -0000
@@ -1040,17 +1040,27 @@
float
{
SKEL->appendValue();
+#ifndef OSG_2_PREP
DynamicVolume dv(DynamicVolume::BOX_VOLUME);
BoxVolume &bv = dynamic_cast<BoxVolume&>(dv.getInstance());
bv.setBounds(SKEL->_tmpFloat1, SKEL->_tmpFloat2, SKEL->_tmpFloat3, SKEL->_tmpFloat4, $1, $3);
SKEL->addVolumeValue(dv);
+#else
+ BoxVolume bv;
+ bv.setBounds(SKEL->_tmpFloat1, SKEL->_tmpFloat2, SKEL->_tmpFloat3, SKEL->_tmpFloat4, $1, $3);
+ SKEL->addVolumeValue(bv);
+#endif
}
| /* empty */
{
+#ifndef OSG_2_PREP
DynamicVolume dv(DynamicVolume::SPHERE_VOLUME);
SphereVolume &sv = dynamic_cast<SphereVolume&>(dv.getInstance());
sv.setValue(Pnt3f(SKEL->_tmpFloat1, SKEL->_tmpFloat2, SKEL->_tmpFloat3), SKEL->_tmpFloat4);
SKEL->addVolumeValue(dv);
+#else
+ FFASSERT(false, 0, ("ScanParseSkel::sfVolumeValueEnd: Can not parse sphere volume.\n");)
+#endif
};
mfcolor4iValue:
Index: Source/System/GraphOp/OSGPruneGraphOp.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/GraphOp/OSGPruneGraphOp.cpp,v
retrieving revision 1.3
diff -u -r1.3 OSGPruneGraphOp.cpp
--- Source/System/GraphOp/OSGPruneGraphOp.cpp 11 Jun 2008 11:28:54 -0000 1.3
+++ Source/System/GraphOp/OSGPruneGraphOp.cpp 17 Jun 2008 16:28:41 -0000
@@ -134,20 +134,31 @@
return res;
}
-bool PruneGraphOp::isTooSmall(const NodePtr& node) {
+bool PruneGraphOp::isTooSmall(const NodePtr& node)
+{
return getSize(node) < _size;
}
-float PruneGraphOp::getSize(const NodePtr& node) {
- const DynamicVolume& dv = node->editVolume(true);
- if (_method == VOLUME) {
- return dv.getScalarVolume();
- } else if (_method == SUM_OF_DIMENSIONS) {
+float PruneGraphOp::getSize(const NodePtr& node)
+{
+#ifndef OSG_2_PREP
+ const DynamicVolume &vol = node->editVolume(true);
+#else
+ const BoxVolume &vol = node->editVolume(true);
+#endif
+ if (_method == VOLUME)
+ {
+ return vol.getScalarVolume();
+ }
+ else if (_method == SUM_OF_DIMENSIONS)
+ {
Pnt3f min, max;
- dv.getBounds(min, max);
+ vol.getBounds(min, max);
Vec3f diff = max - min;
return diff[0] + diff[1] + diff[2];
- } else {
+ }
+ else
+ {
SWARNING << "Unknown size calculation method" << std::endl;
return 0;
}
Index: Source/System/NodeCores/Drawables/Geometry/OSGGeoFunctions.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/NodeCores/Drawables/Geometry/OSGGeoFunctions.cpp,v
retrieving revision 1.59
diff -u -r1.59 OSGGeoFunctions.cpp
--- Source/System/NodeCores/Drawables/Geometry/OSGGeoFunctions.cpp 11 Jun 2008 11:28:55 -0000 1.59
+++ Source/System/NodeCores/Drawables/Geometry/OSGGeoFunctions.cpp 17 Jun 2008 16:28:41 -0000
@@ -1815,9 +1815,13 @@
if (node != NullFC)
{
- DynamicVolume &dVol = node->editVolume(true);
+#ifndef OSG_2_PREP
+ DynamicVolume &vol = node->editVolume(true);
+#else
+ BoxVolume &vol = node->editVolume(true);
+#endif
Pnt3f min, max;
- dVol.getBounds(min, max);
+ vol.getBounds(min, max);
Vec3f dia(max - min);
for (i=0; i<3; i++)
Index: Source/System/NodeCores/Drawables/Geometry/OSGGeometry.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/NodeCores/Drawables/Geometry/OSGGeometry.cpp,v
retrieving revision 1.53
diff -u -r1.53 OSGGeometry.cpp
--- Source/System/NodeCores/Drawables/Geometry/OSGGeometry.cpp 11 Jun 2008 11:28:55 -0000 1.53
+++ Source/System/NodeCores/Drawables/Geometry/OSGGeometry.cpp 17 Jun 2008 16:28:42 -0000
@@ -1158,10 +1158,14 @@
Action::ResultE Geometry::intersect(Action * action)
{
- IntersectAction * ia = dynamic_cast<IntersectAction*>(action);
- const DynamicVolume &dv = ia->getActNode()->editVolume(true);
+ IntersectAction * ia = dynamic_cast<IntersectAction*>(action);
+#ifndef OSG_2_PREP
+ const DynamicVolume &vol = ia->getActNode()->editVolume(true);
+#else
+ const BoxVolume &vol = ia->getActNode()->editVolume(true);
+#endif
- if(dv.isValid() && !dv.intersect(ia->getLine()))
+ if(vol.isValid() && !vol.intersect(ia->getLine()))
{
return Action::Skip; //bv missed -> can not hit children
}
Index: Source/System/NodeCores/Drawables/Geometry/OSGGeometry.h
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/NodeCores/Drawables/Geometry/OSGGeometry.h,v
retrieving revision 1.22
diff -u -r1.22 OSGGeometry.h
--- Source/System/NodeCores/Drawables/Geometry/OSGGeometry.h 15 Dec 2007 19:43:12 -0000 1.22
+++ Source/System/NodeCores/Drawables/Geometry/OSGGeometry.h 17 Jun 2008 16:28:42 -0000
@@ -267,7 +267,11 @@
UInt32 _nprimitives;
UInt32 _numBytesOnGfxCard;
+#ifndef OSG_2_PREP
DynamicVolume _volume;
+#else
+ BoxVolume _volume;
+#endif
};
typedef Geometry *GeometryP;
Index: Source/System/NodeCores/Drawables/Geometry/OSGVolumeDraw.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/NodeCores/Drawables/Geometry/OSGVolumeDraw.cpp,v
retrieving revision 1.8
diff -u -r1.8 OSGVolumeDraw.cpp
--- Source/System/NodeCores/Drawables/Geometry/OSGVolumeDraw.cpp 10 Jun 2008 05:52:20 -0000 1.8
+++ Source/System/NodeCores/Drawables/Geometry/OSGVolumeDraw.cpp 17 Jun 2008 16:28:42 -0000
@@ -57,7 +57,7 @@
OSG_USING_NAMESPACE
-
+#ifndef OSG_2_PREP
/*! \ingroup GrpSystemDrawablesGeometryFunctions
Draw the given DynamicVolume using direct OpenGL calls.
*/
@@ -87,6 +87,7 @@
drawVolume(*fv);
}
}
+#endif
/*! \ingroup GrpSystemDrawablesGeometryFunctions
Draw the given BoxVolume using direct OpenGL calls.
@@ -266,9 +267,15 @@
{
public:
+#ifndef OSG_2_PREP
VolumeDrawWrapper(const DynamicVolume &vol, Color3f col) :
_vol(vol), _col(col)
{}
+#else
+ VolumeDrawWrapper(const BoxVolume &vol, Color3f col) :
+ _vol(vol), _col(col)
+ {}
+#endif
~VolumeDrawWrapper()
{}
@@ -280,7 +287,11 @@
drop(action, node->getVolume(), col);
}
+#ifndef OSG_2_PREP
static void drop(DrawActionBase *action, const DynamicVolume &volume, Color3f col)
+#else
+ static void drop(DrawActionBase *action, const BoxVolume &volume, Color3f col)
+#endif
{
VolumeDrawWrapper * vdw = new VolumeDrawWrapper(volume, col);
@@ -305,7 +316,11 @@
return Action::Continue;
}
- DynamicVolume _vol;
+#ifndef OSG_2_PREP
+ DynamicVolume _vol;
+#else
+ BoxVolume _vol;
+#endif
Color3f _col;
};
@@ -319,6 +334,7 @@
return;
}
+#ifndef OSG_2_PREP
/*! \ingroup GrpSystemDrawablesGeometryFunctions
Draw the volume.
*/
@@ -328,3 +344,16 @@
VolumeDrawWrapper::drop(action, volume, col);
return;
}
+
+#else
+
+/*! \ingroup GrpSystemDrawablesGeometryFunctions
+ Draw the volume.
+*/
+OSG_SYSTEMLIB_DLLMAPPING
+void OSG::dropVolume(DrawActionBase *action, const BoxVolume &volume, Color3f col)
+{
+ VolumeDrawWrapper::drop(action, volume, col);
+ return;
+}
+#endif
Index: Source/System/NodeCores/Drawables/Geometry/OSGVolumeDraw.h
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/NodeCores/Drawables/Geometry/OSGVolumeDraw.h,v
retrieving revision 1.6
diff -u -r1.6 OSGVolumeDraw.h
--- Source/System/NodeCores/Drawables/Geometry/OSGVolumeDraw.h 6 Jun 2005 16:26:00 -0000 1.6
+++ Source/System/NodeCores/Drawables/Geometry/OSGVolumeDraw.h 17 Jun 2008 16:28:42 -0000
@@ -58,7 +58,9 @@
/*! \name Draw Functions */
/*! \{ */
+#ifndef OSG_2_PREP
OSG_SYSTEMLIB_DLLMAPPING void drawVolume(const DynamicVolume &volume);
+#endif
OSG_SYSTEMLIB_DLLMAPPING void drawVolume(const BoxVolume &volume);
OSG_SYSTEMLIB_DLLMAPPING void drawVolume(const SphereVolume &volume);
OSG_SYSTEMLIB_DLLMAPPING void drawVolume(const FrustumVolume &volume);
@@ -68,9 +70,15 @@
NodePtr node,
Color3f col);
-OSG_SYSTEMLIB_DLLMAPPING void dropVolume(DrawActionBase *action,
- const DynamicVolume &volume,
- Color3f col);
+#ifndef OSG_2_PREP
+OSG_SYSTEMLIB_DLLMAPPING void dropVolume( DrawActionBase *action,
+ const DynamicVolume &volume,
+ Color3f col );
+#else
+OSG_SYSTEMLIB_DLLMAPPING void dropVolume( DrawActionBase *action,
+ const BoxVolume &volume,
+ Color3f col );
+#endif
/*! \} */
Index: Source/System/NodeCores/Drawables/Nurbs/OSGSurface.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/NodeCores/Drawables/Nurbs/OSGSurface.cpp,v
retrieving revision 1.11
diff -u -r1.11 OSGSurface.cpp
--- Source/System/NodeCores/Drawables/Nurbs/OSGSurface.cpp 9 Jun 2008 07:30:41 -0000 1.11
+++ Source/System/NodeCores/Drawables/Nurbs/OSGSurface.cpp 17 Jun 2008 16:28:42 -0000
@@ -444,10 +444,12 @@
for( parent_idx = 0; parent_idx < parent_cnt; ++parent_idx )
{
+#ifndef OSG_2_PREP
switch( getParents( )[ 0 ]->getVolume( ).getType( ) )
{
case DynamicVolume::BOX_VOLUME:
{
+#endif
Pnt3f bb_min, bb_max;
getParents( )[ 0 ]->getVolume( ).getBounds( bb_min, bb_max );
@@ -492,6 +494,7 @@
{
temp_dist[2] = 0.0;
}
+#ifndef OSG_2_PREP
}
break;
case DynamicVolume::SPHERE_VOLUME:
@@ -514,6 +517,7 @@
}
break;
}
+#endif
curr_dist = temp_dist.squareLength( );
if( curr_dist < min_dist )
{
Index: Source/System/NodeCores/Drawables/VolRen/OSGDVRVolume.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/NodeCores/Drawables/VolRen/OSGDVRVolume.cpp,v
retrieving revision 1.6
diff -u -r1.6 OSGDVRVolume.cpp
--- Source/System/NodeCores/Drawables/VolRen/OSGDVRVolume.cpp 11 Jun 2008 11:28:55 -0000 1.6
+++ Source/System/NodeCores/Drawables/VolRen/OSGDVRVolume.cpp 17 Jun 2008 16:28:42 -0000
@@ -586,10 +586,14 @@
{
FDEBUG(("DVRVolume::intersect\n"));
- IntersectAction *ia = dynamic_cast<IntersectAction*>(action);
- const DynamicVolume &dv = ia->getActNode()->getVolume();
+ IntersectAction *ia = dynamic_cast<IntersectAction*>(action);
+#ifndef OSG_2_PREP
+ const DynamicVolume &vol = ia->getActNode()->getVolume();
+#else
+ const BoxVolume &vol = ia->getActNode()->getVolume();
+#endif
- if(dv.isValid() && !dv.intersect(ia->getLine()))
+ if(vol.isValid() && !vol.intersect(ia->getLine()))
{
return Action::Skip; //bv missed -> can not hit children
}
@@ -599,7 +603,7 @@
Real32 t, v;
Vec3f norm;
- if(dv.intersect(ia->getLine(), t, v))
+ if(vol.intersect(ia->getLine(), t, v))
ia->setHit(t, ia->getActNode(), 0, norm);
return Action::Continue;
Index: Source/System/NodeCores/Groups/Base/OSGGroup.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/NodeCores/Groups/Base/OSGGroup.cpp,v
retrieving revision 1.6
diff -u -r1.6 OSGGroup.cpp
--- Source/System/NodeCores/Groups/Base/OSGGroup.cpp 20 Feb 2006 17:04:46 -0000 1.6
+++ Source/System/NodeCores/Groups/Base/OSGGroup.cpp 17 Jun 2008 16:28:42 -0000
@@ -145,10 +145,14 @@
Action::ResultE Group::intersect(Action *action)
{
- IntersectAction *ia = dynamic_cast<IntersectAction *>(action);
- const DynamicVolume &dv = ia->getActNode()->getVolume();
+ IntersectAction *ia = dynamic_cast<IntersectAction *>(action);
+#ifndef OSG_2_PREP
+ const DynamicVolume &vol = ia->getActNode()->getVolume();
+#else
+ const BoxVolume &vol = ia->getActNode()->getVolume();
+#endif
- if(dv.isValid() && ! dv.intersect(ia->getLine()))
+ if(vol.isValid() && ! vol.intersect(ia->getLine()))
{
return Action::Skip; //bv missed -> can not hit children
}
Index: Source/System/NodeCores/Groups/Misc/OSGProxyGroupBase.h
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/NodeCores/Groups/Misc/OSGProxyGroupBase.h,v
retrieving revision 1.13
diff -u -r1.13 OSGProxyGroupBase.h
--- Source/System/NodeCores/Groups/Misc/OSGProxyGroupBase.h 9 Jun 2008 12:28:19 -0000 1.13
+++ Source/System/NodeCores/Groups/Misc/OSGProxyGroupBase.h 17 Jun 2008 16:28:42 -0000
@@ -57,7 +57,6 @@
#pragma once
#endif
-
#include <OSGConfig.h>
#include <OSGSystemDef.h>
Index: Source/System/Window/OSGSimpleSceneManager.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/Window/OSGSimpleSceneManager.cpp,v
retrieving revision 1.32
diff -u -r1.32 OSGSimpleSceneManager.cpp
--- Source/System/Window/OSGSimpleSceneManager.cpp 9 Jun 2008 07:30:42 -0000 1.32
+++ Source/System/Window/OSGSimpleSceneManager.cpp 17 Jun 2008 16:28:43 -0000
@@ -786,7 +786,11 @@
// FDEBUG (("SimpleSceneManager::updateHightlight() called\n"));
// calc the world bbox of the highlight object
- DynamicVolume vol;
+#ifndef OSG_2_PREP
+ DynamicVolume vol;
+#else
+ BoxVolume vol;
+#endif
_highlight->getWorldVolume(vol);
Pnt3f min,max;
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Opensg-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-core