Skip to content

Commit

Permalink
Create VTK 3.1.2 release
Browse files Browse the repository at this point in the history
The VTK 3.1 release tag in CVS was moved file-wise as fixes were made.
Therefore the true history of the 'branch' is gone.  This commit was
manufactured during conversion from CVS to represent the version as a
merge from all the commits whose files have the tag.
  • Loading branch information
Ken Martin committed Apr 4, 2000
6 parents b628505 + 99ff5a4 + 7f1bea0 + be88af2 + 6efea7d + aaa465d commit 2522acc
Show file tree
Hide file tree
Showing 50 changed files with 651 additions and 708 deletions.
4 changes: 2 additions & 2 deletions README.html
Expand Up @@ -29,7 +29,7 @@ <h1>

<HR>
<h1><A NAME="Copyright">Copyright Notice</h1>
<pre>

Copyright (c) 1993-2000 Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.

Expand Down Expand Up @@ -60,7 +60,7 @@ <h1><A NAME="Copyright">Copyright Notice</h1>
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.<p>
</pre>

<HR>
<h1><A NAME="Introduction">Introduction</h1>

Expand Down
65 changes: 53 additions & 12 deletions common/vtkDataObject.cxx
Expand Up @@ -98,6 +98,7 @@ vtkDataObject::vtkDataObject()
this->MaximumNumberOfPieces = 1;

this->PipelineMTime = 0;
this->LastUpdateExtentWasOutsideOfTheExtent = 0;
}

//----------------------------------------------------------------------------
Expand Down Expand Up @@ -223,37 +224,37 @@ void vtkDataObject::UpdateInformation()
}
break;
}

this->LastUpdateExtentWasOutsideOfTheExtent = 0;
}

//----------------------------------------------------------------------------

void vtkDataObject::PropagateUpdateExtent()
{
// Release data if update extent does not lie within extent
this->ModifyExtentForUpdateExtent();

// If we need to update due to PipelineMTime, or the fact that our
// data was released, then propagate the update extent to the source
// if there is one.
if ( this->UpdateTime < this->PipelineMTime || this->DataReleased )
if ( this->UpdateTime < this->PipelineMTime || this->DataReleased ||
this->UpdateExtentIsOutsideOfTheExtent() ||
this->LastUpdateExtentWasOutsideOfTheExtent)
{
if (this->Source)
{
this->Source->PropagateUpdateExtent(this);
}
}


// update the value of this ivar
this->LastUpdateExtentWasOutsideOfTheExtent =
this->UpdateExtentIsOutsideOfTheExtent();

// Check that the update extent lies within the whole extent
if ( ! this->VerifyUpdateExtent() )
{
// invalid update piece - this should not occur!
return;
}

// Release data if update extent does not lie within extent
// We have to do it again because the source may have modified our
// UpdateExtent during propagation.
this->ModifyExtentForUpdateExtent();
}

//----------------------------------------------------------------------------
Expand All @@ -263,7 +264,8 @@ void vtkDataObject::TriggerAsynchronousUpdate()
// If we need to update due to PipelineMTime, or the fact that our
// data was released, then propagate the trigger to the source
// if there is one.
if ( this->UpdateTime < this->PipelineMTime || this->DataReleased )
if ( this->UpdateTime < this->PipelineMTime || this->DataReleased ||
this->UpdateExtentIsOutsideOfTheExtent())
{
if (this->Source)
{
Expand All @@ -279,7 +281,8 @@ void vtkDataObject::UpdateData()
// If we need to update due to PipelineMTime, or the fact that our
// data was released, then propagate the UpdateData to the source
// if there is one.
if ( this->UpdateTime < this->PipelineMTime || this->DataReleased )
if ( this->UpdateTime < this->PipelineMTime || this->DataReleased ||
this->UpdateExtentIsOutsideOfTheExtent())
{
if (this->Source)
{
Expand Down Expand Up @@ -485,6 +488,40 @@ int vtkDataObject::VerifyUpdateExtent()
return retval;
}


int vtkDataObject::UpdateExtentIsOutsideOfTheExtent()
{
switch ( this->GetExtentType() )
{
case VTK_PIECES_EXTENT:
if ( this->UpdatePiece != this->Piece ||
this->UpdateNumberOfPieces != this->NumberOfPieces )
{
return 1;
}
break;

case VTK_3D_EXTENT:
if ( this->UpdateExtent[0] < this->Extent[0] ||
this->UpdateExtent[1] > this->Extent[1] ||
this->UpdateExtent[2] < this->Extent[2] ||
this->UpdateExtent[3] > this->Extent[3] ||
this->UpdateExtent[4] < this->Extent[4] ||
this->UpdateExtent[5] > this->Extent[5] )
{
return 1;
}
break;

// We should never have this case occur
default:
vtkErrorMacro( << "Internal error - invalid extent type!" );
break;
}
return 0;
}


//----------------------------------------------------------------------------

void vtkDataObject::ModifyExtentForUpdateExtent()
Expand Down Expand Up @@ -546,6 +583,7 @@ void vtkDataObject::CopyInformation( vtkDataObject *data )
}
}


//----------------------------------------------------------------------------

void vtkDataObject::PrintSelf(ostream& os, vtkIndent indent)
Expand Down Expand Up @@ -588,4 +626,7 @@ void vtkDataObject::PrintSelf(ostream& os, vtkIndent indent)

os << indent << "Field Data:\n";
this->FieldData->PrintSelf(os,indent.GetNextIndent());

os << indent << "LastUpdateExtentWasOutsideOfTheExtent: " <<
this->LastUpdateExtentWasOutsideOfTheExtent << endl;
}
12 changes: 12 additions & 0 deletions common/vtkDataObject.h
Expand Up @@ -286,6 +286,15 @@ class VTK_EXPORT vtkDataObject : public vtkObject
// It sets the DataReleased flag to 0, and sets a new UpdateTime.
void DataHasBeenGenerated();

// Description:
// Return non zero if the UpdateExtent is outside of the Extent
virtual int UpdateExtentIsOutsideOfTheExtent();

// Description:
// make the output data ready for new data to be inserted. For most
// objects we just call Initialize. But for imagedata we leave the old
// data in case the memory can be reused.
virtual void PrepareForNewData() {this->Initialize();};

protected:

Expand Down Expand Up @@ -364,6 +373,9 @@ class VTK_EXPORT vtkDataObject : public vtkObject
// This does not include the MTime of this data object.
unsigned long PipelineMTime;

// Was the update extent propogated down the pipeline
int LastUpdateExtentWasOutsideOfTheExtent;

// How many upstream filters are local to the process.
// This will have to change to a float for Kens definition of locality.
float Locality;
Expand Down
33 changes: 33 additions & 0 deletions common/vtkImageData.cxx
Expand Up @@ -139,6 +139,23 @@ void vtkImageData::CopyStructure(vtkDataSet *ds)
this->CopyInformation(sPts);
}

void vtkImageData::PrepareForNewData()
{
// free everything but the scalars
vtkScalars *scalars = this->GetPointData()->GetScalars();
if (scalars)
{
scalars->Register(this);
}
this->Initialize();
if (scalars)
{
this->GetPointData()->SetScalars(scalars);
scalars->UnRegister(this);
}
}


//----------------------------------------------------------------------------

// The input data object must be of type vtkImageData or a subclass!
Expand Down Expand Up @@ -1601,6 +1618,22 @@ void vtkImageData::SetExtent(int *extent)

//----------------------------------------------------------------------------

int vtkImageData::UpdateExtentIsOutsideOfTheExtent()
{
if ( this->UpdateExtent[0] < this->Extent[0] ||
this->UpdateExtent[1] > this->Extent[1] ||
this->UpdateExtent[2] < this->Extent[2] ||
this->UpdateExtent[3] > this->Extent[3] ||
this->UpdateExtent[4] < this->Extent[4] ||
this->UpdateExtent[5] > this->Extent[5] )
{
return 1;
}
return 0;
}

//----------------------------------------------------------------------------

void vtkImageData::ModifyExtentForUpdateExtent()
{
if ( this->UpdateExtent[0] < this->Extent[0] ||
Expand Down
10 changes: 10 additions & 0 deletions common/vtkImageData.h
Expand Up @@ -298,11 +298,21 @@ class VTK_EXPORT vtkImageData : public vtkDataSet
// Must only be called with vtkImageData (or subclass) as input
void CopyTypeSpecificInformation( vtkDataObject *image );

// Description:
// Return non zero if the UpdateExtent is outside of the Extent
virtual int UpdateExtentIsOutsideOfTheExtent();

// Description:
// Needs to be overridden from vtkDataObject so that we can call
// the correct version of SetExtent rather than just doing a memcpy.
virtual void ModifyExtentForUpdateExtent();

// Description:
// make the output data ready for new data to be inserted. For most
// objects we just call Initialize. But for imagedata we leave the old
// data in case the memory can be reused.
virtual void PrepareForNewData();

void SetMemoryLimit( int vtkNotUsed(x) )
{ vtkErrorMacro( << "Memory limit no longer supported - use streamer" ); };

Expand Down
15 changes: 14 additions & 1 deletion common/vtkProperty2D.cxx
Expand Up @@ -71,6 +71,7 @@ vtkProperty2D::vtkProperty2D()
this->Color[0] = 1.0;
this->Color[1] = 1.0;
this->Color[2] = 1.0;
this->DisplayLocation = VTK_FOREGROUND_LOCATION;
}

vtkProperty2D::~vtkProperty2D()
Expand All @@ -89,7 +90,19 @@ void vtkProperty2D::PrintSelf(ostream& os, vtkIndent indent)
<< this->Color[2] << ")\n";
os << indent << "Point size: " << this->PointSize << "\n";
os << indent << "Line width: " << this->LineWidth << "\n";

switch ( this->DisplayLocation )
{
case VTK_FOREGROUND_LOCATION:
os << indent << "Display location: foreground\n";
break;
case VTK_BACKGROUND_LOCATION:
os << indent << "Display location: background\n";
break;
default:
os << indent << "Display location: invalid\n";
break;
}

}


Expand Down
21 changes: 21 additions & 0 deletions common/vtkProperty2D.h
Expand Up @@ -54,6 +54,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

class vtkViewport;

#define VTK_BACKGROUND_LOCATION 0
#define VTK_FOREGROUND_LOCATION 1

class VTK_EXPORT vtkProperty2D : public vtkObject
{
public:
Expand Down Expand Up @@ -87,6 +90,23 @@ class VTK_EXPORT vtkProperty2D : public vtkObject
vtkSetClampMacro(LineWidth,float,0,VTK_LARGE_FLOAT);
vtkGetMacro(LineWidth,float);

// Description:
// The DisplayLocation is either background or foreground.
// If it is background, then this 2D actor will be drawn
// behind all 3D props or foreground 2D actors. If it is
// background, then this 2D actor will be drawn in front of
// all 3D props and background 2D actors. Within 2D actors
// of the same DisplayLocation type, order is determined by
// the order in which the 2D actors were added to the viewport.
vtkSetClampMacro( DisplayLocation, int,
VTK_BACKGROUND_LOCATION, VTK_FOREGROUND_LOCATION );
vtkGetMacro( DisplayLocation, int );
void SetDisplayLocationToBackground()
{this->DisplayLocation = VTK_BACKGROUND_LOCATION;};
void SetDisplayLocationToForeground()
{this->DisplayLocation = VTK_FOREGROUND_LOCATION;};


// Description:
// Have the device specific subclass render this property.
virtual void Render (vtkViewport* vtkNotUsed(viewport)) {}
Expand All @@ -101,6 +121,7 @@ class VTK_EXPORT vtkProperty2D : public vtkObject
float Opacity;
float PointSize;
float LineWidth;
int DisplayLocation;
};


Expand Down
2 changes: 1 addition & 1 deletion common/vtkSource.cxx
Expand Up @@ -347,7 +347,7 @@ void vtkSource::UpdateData(vtkDataObject *vtkNotUsed(output))
{
if (this->Outputs[idx])
{
this->Outputs[idx]->Initialize();
this->Outputs[idx]->PrepareForNewData();
}
}

Expand Down
14 changes: 14 additions & 0 deletions common/vtkStructuredGrid.cxx
Expand Up @@ -173,7 +173,21 @@ void vtkStructuredGrid::Initialize()
this->Blanking = 0;
}


//----------------------------------------------------------------------------
int vtkStructuredGrid::UpdateExtentIsOutsideOfTheExtent()
{
if ( this->UpdateExtent[0] < this->Extent[0] ||
this->UpdateExtent[1] > this->Extent[1] ||
this->UpdateExtent[2] < this->Extent[2] ||
this->UpdateExtent[3] > this->Extent[3] ||
this->UpdateExtent[4] < this->Extent[4] ||
this->UpdateExtent[5] > this->Extent[5] )
{
return 1;
}
return 0;
}

void vtkStructuredGrid::ModifyExtentForUpdateExtent()
{
Expand Down
4 changes: 4 additions & 0 deletions common/vtkStructuredGrid.h
Expand Up @@ -158,6 +158,10 @@ class VTK_EXPORT vtkStructuredGrid : public vtkPointSet {
void SetExtent(int x1, int x2, int y1, int y2, int z1, int z2);
vtkGetVector6Macro(Extent,int);

// Description:
// Return non zero if the UpdateExtent is outside of the Extent
virtual int UpdateExtentIsOutsideOfTheExtent();

// Description:
// Return the actual size of the data in kilobytes. This number
// is valid only after the pipeline has updated. The memory size
Expand Down
7 changes: 7 additions & 0 deletions common/vtkStructuredPoints.cxx
Expand Up @@ -70,6 +70,13 @@ void vtkStructuredPoints::ModifyExtentForUpdateExtent()
this->SetUpdateExtent( this->WholeExtent );
}

void vtkStructuredPoints::PropagateUpdateExtent()
{
// Make sure the extent is the whole extent
this->SetUpdateExtent( this->WholeExtent );

this->vtkImageData::PropagateUpdateExtent();
}



Expand Down
4 changes: 4 additions & 0 deletions common/vtkStructuredPoints.h
Expand Up @@ -75,6 +75,10 @@ class VTK_EXPORT vtkStructuredPoints : public vtkImageData
// vtkStructuredPoints data object.
virtual void ModifyExtentForUpdateExtent();

// Description:
// Internal method in a class we hope to remove
virtual void PropagateUpdateExtent();

protected:
vtkStructuredPoints();
~vtkStructuredPoints() {};
Expand Down
4 changes: 2 additions & 2 deletions common/vtkVersion.h
Expand Up @@ -58,8 +58,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define VTK_VERSION "3.1.1"
#define VTK_MAJOR_VERSION 3
#define VTK_MINOR_VERSION 1
#define VTK_BUILD_VERSION 1
#define VTK_SOURCE_VERSION "vtk version " VTK_VERSION ", vtk source $Revision: 1.434 $, $Date: 2000-02-21 20:31:36 $ (GMT)"
#define VTK_BUILD_VERSION 2
#define VTK_SOURCE_VERSION "vtk version " VTK_VERSION ", vtk source $Revision: 1.476 $, $Date: 2000-04-03 14:51:38 $ (GMT)"


class VTK_EXPORT vtkVersion : public vtkObject {
Expand Down

0 comments on commit 2522acc

Please sign in to comment.