Commit cb52c9ff authored by hrchilds's avatar hrchilds

Update from June 11, 2003

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@10 18c085ea-50e0-402c-830e-de6fd14e8384
parent fc4296e6
......@@ -8412,7 +8412,7 @@ fi
#
echo "$as_me:$LINENO: checking for pthread library" >&5
echo $ECHO_N "checking for pthread library... $ECHO_C" >&6
if -z "$PTHREAD_LIB"; then
if test -z "$PTHREAD_LIB"; then
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
......@@ -8463,12 +8463,18 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
#define HAVE_THREADS 1
_ACEOF
echo "$as_me:$LINENO: result: found" >&5
echo "${ECHO_T}found" >&6
else
PTHREAD_LIB=""
PTHREAD_CXXFLAGS=""
echo "$as_me:$LINENO: result: not found" >&5
echo "${ECHO_T}not found" >&6
fi
else
if test -z "$PTHREAD_CXXFLAGS"; then
echo "$as_me:$LINENO: result: found" >&5
echo "${ECHO_T}found" >&6
if test -z "$PTHREAD_CXXFLAGS"; then
PTHREAD_CXXFLAGS=""
fi
fi
......
......@@ -409,6 +409,9 @@ dnl
dnl Brad Whitlock, Fri May 2 15:06:12 PST 2003
dnl I added libproxybase and the new launcher component.
dnl
dnl Sean Ahern, Wed Jun 11 16:36:52 PDT 2003
dnl Fixed pthreads test.
dnl
dnl --------------------------------------------------------------------------
dnl
......@@ -1898,7 +1901,7 @@ AC_SUBST(X_LIBS)
# a macro in visit-config.h
#
AC_MSG_CHECKING(for pthread library)
if -z "$PTHREAD_LIB"; then
if test -z "$PTHREAD_LIB"; then
AC_TRY_LINK([#include <pthread.h>],[pthread_attr_t attr;
pthread_attr_init(&attr)],
AC_MSG_RESULT(yes)
......@@ -1910,11 +1913,19 @@ if -z "$PTHREAD_LIB"; then
AC_SUBST(ENGINE_CPPFLAGS)
PTHREAD_LIB="-lpthread"
AC_DEFINE(HAVE_THREADS)
AC_MSG_RESULT(found)
else
PTHREAD_LIB=""
PTHREAD_CXXFLAGS=""
AC_MSG_RESULT(not found)
fi
else
AC_MSG_RESULT(found)
dnl
dnl What the heck does this "if" test do? If PTHREAD_CXXFLAGS is the
dnl null string, set it to the null string. ??? Someone fill in a
dnl descriptive comment here.
dnl
if test -z "$PTHREAD_CXXFLAGS"; then
PTHREAD_CXXFLAGS=""
fi
......
......@@ -330,6 +330,11 @@ avtMeshFilter::PerformRestriction(avtPipelineSpecification_p spec)
// Programmer: Hank Childs
// Creation: September 10, 2002
//
// Modifications:
//
// Akira Haddox, Wed May 28 14:56:01 PDT 2003
// LineFilter no longer has a Locator, call removed.
//
// ****************************************************************************
void
......@@ -339,7 +344,6 @@ avtMeshFilter::ReleaseData(void)
lineFilter->SetInput(NULL);
lineFilter->SetOutput(NULL);
lineFilter->SetLocator(NULL);
geometryFilter->SetInput(NULL);
geometryFilter->SetOutput(NULL);
featureEdges->SetInput(NULL);
......
......@@ -4,6 +4,7 @@
#include "vtkObjectFactory.h"
#include "vtkExtractEdges.h"
#include "vtkUnsignedIntArray.h"
#include <vtkVisItUtility.h>
#include <vtkPolyData.h>
......@@ -13,17 +14,20 @@
// Replace 'New' method with Macro to match VTK 4.0 API.
//------------------------------------------------------------------------------
vtkStandardNewMacro(vtkLinesFromOriginalCells);
vtkCxxSetObjectMacro(vtkLinesFromOriginalCells, Locator,vtkPointLocator);
// Construct object.
//------------------------------------------------------------------------------
// Modifications:
// Akira Haddox, Wed May 21 13:43:55 PDT 2003
// Removed Locator code.
//------------------------------------------------------------------------------
vtkLinesFromOriginalCells::vtkLinesFromOriginalCells()
{
this->Locator = NULL;
}
vtkLinesFromOriginalCells::~vtkLinesFromOriginalCells()
{
this->SetLocator(NULL);
}
// ***************************************************************************
......@@ -51,30 +55,32 @@ vtkLinesFromOriginalCells::~vtkLinesFromOriginalCells()
// Made the extractor be an automatic variable, since keeping it around
// just bloats memory.
//
// Akira Haddox, Wed May 21 13:44:23 PDT 2003
// Removed the Locator calls (time consuming relic from vtkExtractLines).
// Replaced some vtk calls with direct access calls for speed.
//
// ****************************************************************************
void vtkLinesFromOriginalCells::Execute()
{
vtkPolyData *input = this->GetInput();
vtkPointData *inPD = input->GetPointData();
vtkCellData *inCD = input->GetCellData();
vtkPolyData *output = this->GetOutput();
vtkPointData *outPD = output->GetPointData();
vtkCellData *outCD = output->GetCellData();
vtkPoints *newPts;
output->SetPoints(vtkVisItUtility::GetPoints(input));
output->GetPointData()->ShallowCopy(input->GetPointData());
vtkCellArray *newLines;
vtkIdList *edgeNeighbors;
int numCells, cellNum, edgeNum, numEdgePts, numCellEdges;
int numPts, i, k, pt2, newId;
vtkIdType pts[2];
int pt1 = 0, neighbor;
float *x;
vtkEdgeTable *edgeTable;
vtkCell *cell, *edge;
bool insert;
vtkDataArray* origCellsArr = inCD->GetArray("avtOriginalCellNumbers");
if ( (!origCellsArr) || (origCellsArr->GetDataType() != VTK_UNSIGNED_INT)
|| (origCellsArr->GetNumberOfComponents() != 2))
......@@ -113,25 +119,15 @@ void vtkLinesFromOriginalCells::Execute()
//
edgeTable = vtkEdgeTable::New();
edgeTable->InitEdgeInsertion(numPts);
newPts = vtkPoints::New();
newPts->Allocate(numPts);
newLines = vtkCellArray::New();
newLines->EstimateSize(numPts*4,2);
outPD->CopyAllocate(inPD,numPts);
outCD->CopyAllocate(outCD,numCells);
// Get our locator for merging points
//
if ( this->Locator == NULL )
{
this->CreateDefaultLocator();
}
this->Locator->InitPointInsertion(newPts, input->GetBounds());
edgeNeighbors = vtkIdList::New();
// Loop over all cells, extracting non-visited edges.
//
for (cellNum=0; cellNum < numCells; cellNum++ )
{
if ( ! (cellNum % 10000) ) //manage progress reports / early abort
......@@ -153,19 +149,17 @@ void vtkLinesFromOriginalCells::Execute()
for ( i=0; i < numEdgePts; i++, pt1=pt2, pts[0]=pts[1] )
{
pt2 = edge->PointIds->GetId(i);
x = input->GetPoint(pt2);
if ( this->Locator->InsertUniquePoint(x, pts[1]) )
{
outPD->CopyData(inPD,pt2,pts[1]);
}
pts[1] = pt2;
if ( i > 0 && edgeTable->IsEdge(pt1,pt2) == -1 )
{
insert = true;
input->GetCellEdgeNeighbors(cellNum, pt1, pt2,edgeNeighbors);
vtkIdType *neighborIdList = edgeNeighbors->GetPointer(0);
for (k = 0; k < edgeNeighbors->GetNumberOfIds(); k++)
{
neighbor = edgeNeighbors->GetId(k);
neighbor = neighborIdList[k];
if (origCellNums[2*cellNum+1] == origCellNums[2*neighbor+1]
&& (!cellNums3D || cellNums3D[cellNum] != cellNums3D[neighbor]))
{
......@@ -203,50 +197,9 @@ void vtkLinesFromOriginalCells::Execute()
edgeTable->Delete();
edgeNeighbors->Delete();
output->SetPoints(newPts);
newPts->Delete();
output->SetLines(newLines);
newLines->Delete();
output->Squeeze();
}
void vtkLinesFromOriginalCells::CreateDefaultLocator()
{
if ( this->Locator == NULL )
{
this->Locator = vtkMergePoints::New();
this->Locator->Register(this);
this->Locator->Delete();
}
}
void vtkLinesFromOriginalCells::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
if ( this->Locator )
{
this->Locator->PrintSelf(os, indent);
}
else
{
os << indent << "Locator: (none)\n";
}
}
unsigned long int vtkLinesFromOriginalCells::GetMTime()
{
unsigned long mTime = this->Superclass::GetMTime();
unsigned long time;
if ( this->Locator != NULL )
{
time = this->Locator->GetMTime();
mTime = ( time > mTime ? time : mTime );
}
return mTime;
}
......@@ -14,28 +14,12 @@
#include <visit_vtk_exports.h>
#include "vtkPolyDataToPolyDataFilter.h"
#include <vtkPointLocator.h>
class VISIT_VTK_API vtkLinesFromOriginalCells : public vtkPolyDataToPolyDataFilter
{
public:
static vtkLinesFromOriginalCells *New();
vtkTypeMacro(vtkLinesFromOriginalCells,vtkPolyDataToPolyDataFilter);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Set / get a spatial locator for merging points. By
// default an instance of vtkMergePoints is used.
virtual void SetLocator(vtkPointLocator*);
vtkGetObjectMacro(Locator,vtkPointLocator);
// Description:
// Create default locator. Used to create one when none is specified.
void CreateDefaultLocator();
// Description:
// Return MTime also considering the locator.
unsigned long GetMTime();
protected:
vtkLinesFromOriginalCells();
......@@ -44,8 +28,6 @@ protected:
// Usual data generation method
void Execute();
vtkPointLocator *Locator;
private:
vtkLinesFromOriginalCells(const vtkLinesFromOriginalCells&);
void operator=(const vtkLinesFromOriginalCells&);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment