Attached Files | dif [^] (2,986 bytes) 1969-12-31 19:00 [Show Content] [Hide Content]CVS dif for first method of fixing:
Index: Rendering/vtkAssembly.cxx
===================================================================
RCS file: /cvsroot/VTK/VTK/Rendering/vtkAssembly.cxx,v
retrieving revision 1.57
diff -u -r1.57 vtkAssembly.cxx
--- Rendering/vtkAssembly.cxx 4 Jan 2005 20:56:39 -0000 1.57
+++ Rendering/vtkAssembly.cxx 2 Jun 2006 12:31:48 -0000
@@ -99,8 +99,29 @@
vtkCollectionSimpleIterator sit;
for ( this->Paths->InitTraversal(sit); (path = this->Paths->GetNextPath(sit)); )
{
+
+//DCS fix visibility so that vtkAssembly turns off children
+//
+ vtkAssemblyNode *tNode;
+ bool tVisibility = true;
+
+ for(path->InitTraversal(); tNode = path->GetNextNode();) {
+
+ vtkProp3D *tProp = (vtkProp3D *) tNode->GetViewProp();
+
+ if(!tProp->GetVisibility()) {
+ tVisibility = false;
+ break;
+ }
+ }
+//DCS
+
prop3D = (vtkProp3D *)path->GetLastNode()->GetViewProp();
- if ( prop3D->GetVisibility() )
+
+//DCS
+// if ( prop3D->GetVisibility() )
+ if (tVisibility)
+//DCS
prop3D->SetAllocatedRenderTime(fraction, ren);
prop3D->PokeMatrix(path->GetLastNode()->GetMatrix());
@@ -138,8 +159,29 @@
vtkCollectionSimpleIterator sit;
for ( this->Paths->InitTraversal(sit); (path = this->Paths->GetNextPath(sit)); )
{
+
+//DCS fix visibility so that vtkAssembly turns off children
+//
+ vtkAssemblyNode *tNode;
+ bool tVisibility = true;
+
+ for(path->InitTraversal(); tNode = path->GetNextNode();) {
+
+ vtkProp3D *tProp = (vtkProp3D *) tNode->GetViewProp();
+
+ if(!tProp->GetVisibility()) {
+ tVisibility = false;
+ break;
+ }
+ }
+//DCS
+
prop3D = (vtkProp3D *)path->GetLastNode()->GetViewProp();
- if ( prop3D->GetVisibility() )
+
+//DCS
+// if ( prop3D->GetVisibility() )
+ if (tVisibility)
+//DCS
{
prop3D->PokeMatrix(path->GetLastNode()->GetMatrix());
prop3D->SetAllocatedRenderTime(fraction, ren);
CVS dif for second method of fixing:
Index: Rendering/vtkAssembly.cxx
===================================================================
RCS file: /cvsroot/VTK/VTK/Rendering/vtkAssembly.cxx,v
retrieving revision 1.57
diff -u -r1.57 vtkAssembly.cxx
--- Rendering/vtkAssembly.cxx 4 Jan 2005 20:56:39 -0000 1.57
+++ Rendering/vtkAssembly.cxx 2 Jun 2006 12:35:22 -0000
@@ -279,14 +283,18 @@
for ( this->Parts->InitTraversal(pit);
(prop3D = this->Parts->GetNextProp3D(pit)); )
{
- path->AddNode(prop3D,prop3D->GetMatrix());
+ // only add in props which have visible parents
+ if ( prop3D->GetVisibility() )
+ {
+ path->AddNode(prop3D,prop3D->GetMatrix());
- // dive into the hierarchy
- prop3D->BuildPaths(paths,path);
+ // dive into the hierarchy
+ prop3D->BuildPaths(paths,path);
- // when returned, pop the last node off of the
- // current path
- path->DeleteLastNode();
+ // when returned, pop the last node off of the
+ // current path
+ path->DeleteLastNode();
+ }
}
}
vtkAssemblyPath.cxx.patch [^] (814 bytes) 1969-12-31 19:00 [Show Content] [Hide Content]### Eclipse Workspace Patch 1.0
#P VTK
Index: Common/vtkAssemblyPath.cxx
===================================================================
RCS file: /cvsroot/VTK/VTK/Common/vtkAssemblyPath.cxx,v
retrieving revision 1.8
diff -u -r1.8 vtkAssemblyPath.cxx
--- Common/vtkAssemblyPath.cxx 4 Jan 2005 20:56:38 -0000 1.8
+++ Common/vtkAssemblyPath.cxx 3 Aug 2006 19:39:31 -0000
@@ -91,6 +91,22 @@
}
}
+int vtkAssemblyPath::GetVisibility()
+{
+ vtkAssemblyNode *node;
+ vtkCollectionSimpleIterator sit;
+
+ for (this->InitTraversal(sit); (node = this->GetNextNode(sit)); )
+ {
+ if (node->GetViewProp()->GetVisibility() == 0)
+ {
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
void vtkAssemblyPath::DeleteLastNode()
{
vtkAssemblyNode *node = this->GetLastNode();
vtkAssemblyPath.h.patch [^] (838 bytes) 1969-12-31 19:00 [Show Content] [Hide Content]### Eclipse Workspace Patch 1.0
#P VTK
Index: Common/vtkAssemblyPath.h
===================================================================
RCS file: /cvsroot/VTK/VTK/Common/vtkAssemblyPath.h,v
retrieving revision 1.10
diff -u -r1.10 vtkAssemblyPath.h
--- Common/vtkAssemblyPath.h 17 Feb 2004 18:15:57 -0000 1.10
+++ Common/vtkAssemblyPath.h 3 Aug 2006 19:38:26 -0000
@@ -70,6 +70,11 @@
// Get the last assembly node in the list. See the comments
// for GetNextNode() regarding the contents of the returned node.
vtkAssemblyNode *GetLastNode();
+
+ // Description:
+ // Gets visibility of path. If one of the nodes on the path is invisible,
+ // the subnodes on the path should also be invisible.
+ int GetVisibility();
// Description:
// Delete the last assembly node in the list. This is like
vtkPropAssembly.cxx.patch [^] (1,104 bytes) 1969-12-31 19:00 [Show Content] [Hide Content]### Eclipse Workspace Patch 1.0
#P VTK
Index: Filtering/vtkPropAssembly.cxx
===================================================================
RCS file: /cvsroot/VTK/VTK/Filtering/vtkPropAssembly.cxx,v
retrieving revision 1.2
diff -u -r1.2 vtkPropAssembly.cxx
--- Filtering/vtkPropAssembly.cxx 4 Jan 2005 20:56:38 -0000 1.2
+++ Filtering/vtkPropAssembly.cxx 3 Aug 2006 19:43:59 -0000
@@ -81,7 +81,7 @@
for ( this->Paths->InitTraversal(sit); (path = this->Paths->GetNextPath(sit)); )
{
prop = path->GetLastNode()->GetViewProp();
- if ( prop->GetVisibility() )
+ if ( path->GetVisibility() )
{
prop->SetAllocatedRenderTime(fraction, ren);
prop->PokeMatrix(path->GetLastNode()->GetMatrix());
@@ -112,7 +112,7 @@
for ( this->Paths->InitTraversal(sit); (path = this->Paths->GetNextPath(sit)); )
{
prop = path->GetLastNode()->GetViewProp();
- if ( prop->GetVisibility() )
+ if ( path->GetVisibility() )
{
prop->SetAllocatedRenderTime(fraction, ren);
prop->PokeMatrix(path->GetLastNode()->GetMatrix());
vtkAssembly.cxx.patch [^] (1,131 bytes) 1969-12-31 19:00 [Show Content] [Hide Content]### Eclipse Workspace Patch 1.0
#P VTK
Index: Rendering/vtkAssembly.cxx
===================================================================
RCS file: /cvsroot/VTK/VTK/Rendering/vtkAssembly.cxx,v
retrieving revision 1.57
diff -u -r1.57 vtkAssembly.cxx
--- Rendering/vtkAssembly.cxx 4 Jan 2005 20:56:39 -0000 1.57
+++ Rendering/vtkAssembly.cxx 3 Aug 2006 19:41:19 -0000
@@ -100,7 +100,7 @@
for ( this->Paths->InitTraversal(sit); (path = this->Paths->GetNextPath(sit)); )
{
prop3D = (vtkProp3D *)path->GetLastNode()->GetViewProp();
- if ( prop3D->GetVisibility() )
+ if ( path->GetVisibility() )
{
prop3D->SetAllocatedRenderTime(fraction, ren);
prop3D->PokeMatrix(path->GetLastNode()->GetMatrix());
@@ -139,7 +139,7 @@
for ( this->Paths->InitTraversal(sit); (path = this->Paths->GetNextPath(sit)); )
{
prop3D = (vtkProp3D *)path->GetLastNode()->GetViewProp();
- if ( prop3D->GetVisibility() )
+ if ( path->GetVisibility() )
{
prop3D->PokeMatrix(path->GetLastNode()->GetMatrix());
prop3D->SetAllocatedRenderTime(fraction, ren);
proposal_v0.0_vtkAssembly.cxx.patch [^] (1,322 bytes) 1969-12-31 19:00 [Show Content] [Hide Content]91c91
< this->UpdatePaths();
---
> this->InitPathTraversal();
130c130
< this->UpdatePaths();
---
> this->InitPathTraversal();
257c257,259
< path->AddNode(prop3D,prop3D->GetMatrix());
---
> if (prop3D->GetVisibility())
> {
> path->AddNode(prop3D,prop3D->GetMatrix());
259,260c261,262
< // dive into the hierarchy
< prop3D->BuildPaths(this->Paths,path);
---
> // dive into the hierarchy
> prop3D->BuildPaths(this->Paths,path);
262,264c264,267
< // when returned, pop the last node off of the
< // current path
< path->DeleteLastNode();
---
> // when returned, pop the last node off of the
> // current path
> path->DeleteLastNode();
> }
282c285,287
< path->AddNode(prop3D,prop3D->GetMatrix());
---
> if (prop3D->GetVisibility())
> {
> path->AddNode(prop3D,prop3D->GetMatrix());
284,285c289,290
< // dive into the hierarchy
< prop3D->BuildPaths(paths,path);
---
> // dive into the hierarchy
> prop3D->BuildPaths(paths,path);
287,289c292,295
< // when returned, pop the last node off of the
< // current path
< path->DeleteLastNode();
---
> // when returned, pop the last node off of the
> // current path
> path->DeleteLastNode();
> }
proposal_v0.0_vtkPropAssembly.cxx.patch [^] (1,527 bytes) 1969-12-31 19:00 [Show Content] [Hide Content]75a76,78
> // Make sure the paths are up-to-date
> this->InitPathTraversal();
>
105c108
< this->UpdatePaths();
---
> this->InitPathTraversal();
136c139
< this->UpdatePaths();
---
> this->InitPathTraversal();
313c316
< path->AddNode(this,NULL);
---
> path->AddNode(this,this->GetMatrix());
321,322c324,327
< // add a matrix, if any
< path->AddNode(prop,prop->GetMatrix());
---
> if (prop->GetVisibility())
> {
> // add a matrix, if any
> path->AddNode(prop,prop->GetMatrix());
324,325c329,330
< // dive into the hierarchy
< prop->BuildPaths(this->Paths,path);
---
> // dive into the hierarchy
> prop->BuildPaths(this->Paths,path);
327,329c332,335
< // when returned, pop the last node off of the
< // current path
< path->DeleteLastNode();
---
> // when returned, pop the last node off of the
> // current path
> path->DeleteLastNode();
> }
346c352,354
< path->AddNode(prop,NULL);
---
> if (prop->GetVisibility())
> {
> path->AddNode(prop,this->GetMatrix());
348,349c356,357
< // dive into the hierarchy
< prop->BuildPaths(paths,path);
---
> // dive into the hierarchy
> prop->BuildPaths(paths,path);
351,353c359,362
< // when returned, pop the last node off of the
< // current path
< path->DeleteLastNode();
---
> // when returned, pop the last node off of the
> // current path
> path->DeleteLastNode();
> }
|