Commit 85abf26d authored by hrchilds's avatar hrchilds

Update from August 27, 2003

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@67 18c085ea-50e0-402c-830e-de6fd14e8384
parent 82faf5f9
#include <RenderingAttributes.h>
#include <DataNode.h>
const int RenderingAttributes::DEFAULT_SCALABLE_THRESHOLD = 2000000;
//
// Enum conversion methods for RenderingAttributes::GeometryRepresentation
//
......@@ -86,7 +88,7 @@ RenderingAttributes::StereoTypes_FromString(const std::string &s, RenderingAttri
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:31:29 PDT 2003
// Creation: Tue Aug 26 18:47:24 PST 2003
//
// Modifications:
//
......@@ -101,7 +103,7 @@ RenderingAttributes::RenderingAttributes() : AttributeSubject("bibbibbi")
stereoType = CrystalEyes;
notifyForEachRender = false;
scalableRendering = false;
scalableThreshold = 0;
scalableThreshold = 2000000;
}
// ****************************************************************************
......@@ -113,7 +115,7 @@ RenderingAttributes::RenderingAttributes() : AttributeSubject("bibbibbi")
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:31:29 PDT 2003
// Creation: Tue Aug 26 18:47:24 PST 2003
//
// Modifications:
//
......@@ -142,7 +144,7 @@ RenderingAttributes::RenderingAttributes(const RenderingAttributes &obj) : Attri
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:31:29 PDT 2003
// Creation: Tue Aug 26 18:47:24 PST 2003
//
// Modifications:
//
......@@ -162,7 +164,7 @@ RenderingAttributes::~RenderingAttributes()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:31:29 PDT 2003
// Creation: Tue Aug 26 18:47:24 PST 2003
//
// Modifications:
//
......@@ -192,7 +194,7 @@ RenderingAttributes::operator = (const RenderingAttributes &obj)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:31:29 PDT 2003
// Creation: Tue Aug 26 18:47:24 PST 2003
//
// Modifications:
//
......@@ -221,7 +223,7 @@ RenderingAttributes::operator == (const RenderingAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:31:29 PDT 2003
// Creation: Tue Aug 26 18:47:24 PST 2003
//
// Modifications:
//
......@@ -242,7 +244,7 @@ RenderingAttributes::operator != (const RenderingAttributes &obj) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:31:29 PDT 2003
// Creation: Tue Aug 26 18:47:24 PST 2003
//
// Modifications:
//
......@@ -263,7 +265,7 @@ RenderingAttributes::TypeName() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:31:29 PDT 2003
// Creation: Tue Aug 26 18:47:24 PST 2003
//
// Modifications:
//
......@@ -291,7 +293,7 @@ RenderingAttributes::CopyAttributes(const AttributeGroup *atts)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:31:29 PDT 2003
// Creation: Tue Aug 26 18:47:24 PST 2003
//
// Modifications:
//
......@@ -317,7 +319,7 @@ RenderingAttributes::CreateCompatible(const std::string &tname) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:31:29 PDT 2003
// Creation: Tue Aug 26 18:47:24 PST 2003
//
// Modifications:
//
......@@ -344,7 +346,7 @@ RenderingAttributes::NewInstance(bool copy) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:31:29 PDT 2003
// Creation: Tue Aug 26 18:47:24 PST 2003
//
// Modifications:
//
......@@ -376,7 +378,7 @@ RenderingAttributes::SelectAll()
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:31:29 PDT 2003
// Creation: Tue Aug 26 18:47:24 PST 2003
//
// Modifications:
//
......@@ -460,7 +462,7 @@ RenderingAttributes::CreateNode(DataNode *parentNode, bool forceAdd)
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:31:29 PDT 2003
// Creation: Tue Aug 26 18:47:24 PST 2003
//
// Modifications:
//
......@@ -648,7 +650,7 @@ RenderingAttributes::GetScalableThreshold() const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:31:29 PDT 2003
// Creation: Tue Aug 26 18:47:24 PST 2003
//
// Modifications:
//
......@@ -680,7 +682,7 @@ RenderingAttributes::GetFieldName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:31:29 PDT 2003
// Creation: Tue Aug 26 18:47:24 PST 2003
//
// Modifications:
//
......@@ -712,7 +714,7 @@ RenderingAttributes::GetFieldType(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:31:29 PDT 2003
// Creation: Tue Aug 26 18:47:24 PST 2003
//
// Modifications:
//
......@@ -744,7 +746,7 @@ RenderingAttributes::GetFieldTypeName(int index) const
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:31:29 PDT 2003
// Creation: Tue Aug 26 18:47:24 PST 2003
//
// Modifications:
//
......
Constant: DEFAULT_SCALABLE_THRESHOLD
Declaration: static const int DEFAULT_SCALABLE_THRESHOLD;
Definition: const int RenderingAttributes::DEFAULT_SCALABLE_THRESHOLD = 2000000;
......@@ -13,7 +13,7 @@
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Jul 23 11:31:29 PDT 2003
// Creation: Tue Aug 26 18:47:24 PST 2003
//
// Modifications:
//
......@@ -34,6 +34,7 @@ public:
Interlaced,
CrystalEyes
};
static const int DEFAULT_SCALABLE_THRESHOLD;
RenderingAttributes();
RenderingAttributes(const RenderingAttributes &obj);
......
<?xml version="1.0"?>
<Attribute name="RenderingAttributes" purpose="This class contains special rendering attributes like antialiasing and stero settings." exportAPI="STATE_API" exportInclude="state_exports.h">
<Attribute name="RenderingAttributes" purpose="This class contains special rendering attributes like antialiasing and stero settings." exportAPI="STATE_API" exportInclude="state_exports.h" codefile="RenderingAttributes.code">
<Constant name="DEFAULT_SCALABLE_THRESHOLD" member="false"></Constant>
<Enum name="GeometryRepresentation">
Surfaces
Wireframe
......@@ -17,5 +18,5 @@
<Field name="stereoType" type="enum" subtype="StereoTypes">CrystalEyes</Field>
<Field name="notifyForEachRender" type="bool">false</Field>
<Field name="scalableRendering" type="bool">false</Field>
<Field name="scalableThreshold" type="int">0</Field>
<Field name="scalableThreshold" type="int">2000000</Field>
</Attribute>
......@@ -8,13 +8,13 @@
#include <avtCellTypes.h>
#include <avtSamplePoints.h>
class avtHexahedronExtractor;
class avtImagePartition;
class avtPyramidExtractor;
class avtTetrahedronExtractor;
class avtWedgeExtractor;
class avtVolume;
typedef struct
......@@ -28,6 +28,7 @@ typedef struct
} avtSerializedCell;
// ****************************************************************************
// Class: avtCellList
//
......@@ -67,6 +68,7 @@ class PIPELINE_API avtCellList
char *ConstructMessages(avtImagePartition *, char **,
int *);
void EstimateNumberOfSamplesPerScanline(int *);
int GetNumberOfCells(void) const { return celllistI; };
protected:
avtSerializedCell **celllist;
......
......@@ -44,6 +44,7 @@ class PIPELINE_API avtDataObject
void SetSource(avtDataObjectSource *);
avtDataObjectInformation &GetInfo(void) { return info; };
virtual int GetNumberOfCells(void) const = 0;
virtual const char *GetType(void) = 0;
virtual void ReleaseData(void);
......
......@@ -221,7 +221,7 @@ avtDataObjectInformation::ParallelMerge(const avtDataObjectWriter_p dobw)
char *reducedStr = new char [reducedLen];
// copy localStr to the copiedStr buffer for MPI
strncpy(copiedStr, localStr, len);
memcpy(copiedStr, localStr, len);
// create mpi type to circumvent possible buffer chopping during reduce
MPI_Type_contiguous(reducedLen, MPI_CHAR, &mpiTypeDobStr);
......
......@@ -330,6 +330,30 @@ avtDataRepresentation::Valid(void)
return (asVTK != NULL || asChar != NULL ? true : false);
}
// ****************************************************************************
// Method: avtDataRepresentation::GetNumberOfCells
//
// Purpose:
// Count number of cells in this object
//
// Programmer: Mark C. Miller
// Creation: 19Aug03
//
// ****************************************************************************
int
avtDataRepresentation::GetNumberOfCells(void) const
{
if (asVTK == NULL)
{
if (asChar == NULL)
EXCEPTION0(NoInputException);
return -1;
}
else
return (int) asVTK->GetNumberOfCells();
}
// ****************************************************************************
// Method: avtDataRepresentation::GetDataString
......
......@@ -69,6 +69,7 @@ class PIPELINE_API avtDataRepresentation
vtkDataSet *GetDataVTK(void);
unsigned char *GetDataString(int &, DataSetType &);
int GetNumberOfCells(void) const;
bool Valid(void);
......
......@@ -384,6 +384,7 @@ avtDataTree::avtDataTree(int n, avtDataRepresentation *drep)
avtDataTree::avtDataTree(avtDataTree_p dt, bool dontCopyData)
{
if (*dt == NULL)
{
EXCEPTION0(NoInputException);
......@@ -414,9 +415,13 @@ avtDataTree::avtDataTree(avtDataTree_p dt, bool dontCopyData)
}
else
{
dataRep = new avtDataRepresentation( dt->GetDataRepresentation() );
if (dt->dataRep != NULL)
dataRep = new avtDataRepresentation( dt->GetDataRepresentation() );
else
dataRep = NULL;
}
}
}
......@@ -600,6 +605,39 @@ avtDataTree::GetDataRepresentation()
return *dataRep;
}
// ****************************************************************************
// Method: avtDataTree::GetNumberOfCells
//
// Purpose:
// To count the number of cells (polys, elements, etc.) of all datasets
// in tree
//
// Programmer: Mark C. Miller
// Creation: 19Aug03
//
// ****************************************************************************
int
avtDataTree::GetNumberOfCells(void) const
{
if (nChildren > 0)
{
int sum = 0;
for (int i = 0; i < nChildren; i++)
{
if (*children[i] != NULL)
sum += children[i]->GetNumberOfCells();
}
return sum;
}
else if (dataRep != NULL)
{
return dataRep->GetNumberOfCells();
}
return 0;
}
// ****************************************************************************
// Method: avtDataTree::GetAllLeaves
......@@ -1225,6 +1263,7 @@ avtDataTree::WriteTreeStructure(ostream &os, int indent)
os << " label: " << dataRep->GetLabel().c_str() << " ";
}
}
os << "\n";
}
......
......@@ -97,6 +97,7 @@ class PIPELINE_API avtDataTree
avtDataTree_p GetChild(int);
avtDataRepresentation &GetDataRepresentation(void);
int GetNumberOfCells(void) const;
vtkDataSet *GetSingleLeaf(void);
int GetNumberOfLeaves(void);
......
......@@ -63,6 +63,8 @@ class PIPELINE_API avtDataset : public avtDataObject
virtual ~avtDataset() {;};
virtual const char *GetType(void) { return "avtDataset"; };
virtual int GetNumberOfCells(void) const
{ return dataTree->GetNumberOfCells(); };
virtual void ReleaseData(void);
virtual avtDataObject *Instance(void);
......
......@@ -67,6 +67,23 @@ avtImage::GetImage(void)
return image;
}
// ****************************************************************************
// Method: avtImage::GetNumberOfCells
//
// Purpose:
// Gets number of cells in an image
//
// Programmer: Mark C. Miller
// Creation: 19Aug03
//
// ****************************************************************************
int
avtImage::GetNumberOfCells(void) const
{
return image.GetNumberOfCells();
}
// ****************************************************************************
// Method: avtImage::InstantiateWriter
......
......@@ -46,6 +46,7 @@ class PIPELINE_API avtImage : public avtDataObject
virtual ~avtImage() {;};
virtual const char *GetType(void) { return "avtImage"; };
virtual int GetNumberOfCells(void) const;
virtual avtDataObjectWriter
*InstantiateWriter(void);
virtual void ReleaseData(void);
......
......@@ -647,8 +647,6 @@ void avtImageRepresentation::GetImageFromString(unsigned char *str,
// Programmer: Mark C. Miller
// Creation: 25Feb03
//
//
//
// ****************************************************************************
void
......@@ -678,3 +676,27 @@ avtImageRepresentation::GetSize(int *_rowSize, int *_colSize)
*_rowSize = imageDims[1]; // #rows is y-size
*_colSize = imageDims[0]; // #cols is x-size
}
// ****************************************************************************
// Method: GetNumberOfCells
//
// Purpose: Return the number of cells (pixels) in the image
//
// Programmer: Mark C. Miller
// Creation: 19Aug03
//
// ****************************************************************************
int
avtImageRepresentation::GetNumberOfCells(void) const
{
if (asVTK == NULL)
{
if (asChar == NULL)
{
EXCEPTION0(NoInputException);
}
return -1;
}
return asVTK->GetNumberOfCells();
}
......@@ -58,6 +58,7 @@ class PIPELINE_API avtImageRepresentation
void SetOrigin(const int rowOrigin, const int colOrigin);
void GetOrigin(int *rowOrigin, int *colOrigin) const;
virtual int GetNumberOfCells(void) const;
bool Valid(void);
void ReleaseData(void);
......
......@@ -4,6 +4,7 @@
#ifndef AVT_NULL_DATA_H
#define AVT_NULL_DATA_H
#include <string>
#include <pipeline_exports.h>
#include <ref_ptr.h>
......@@ -11,6 +12,8 @@
class avtDataObjectWriter;
const char * const AVT_NULL_IMAGE_MSG = "avtImage withheld; under scalable threshold";
const char * const AVT_NULL_DATASET_MSG = "avtDataset withheld; over scalable threshold";
// ****************************************************************************
// Class: avtNullData
......@@ -27,15 +30,21 @@ class avtDataObjectWriter;
class PIPELINE_API avtNullData : public avtDataObject
{
public:
avtNullData(avtDataObjectSource *src) : avtDataObject(src) {;};
avtNullData(avtDataObjectSource *src, const char *_typeStr = NULL)
: avtDataObject(src)
{ typeStr = _typeStr ? _typeStr : "avtNullData"; };
virtual ~avtNullData() {;};
virtual const char *GetType(void) { return "avtNullData"; };
virtual const char *GetType(void) { return typeStr.c_str(); };
virtual int GetNumberOfCells(void) const { return 0;};
virtual void SetType(char *_typeStr ) { typeStr = _typeStr; };
avtDataObjectWriter *InstantiateWriter(void);
protected:
virtual void DerivedMerge(avtDataObject *dob) {;};
private:
std::string typeStr;
};
typedef ref_ptr<avtNullData> avtNullData_p;
......
......@@ -10,9 +10,9 @@
#include <ref_ptr.h>
#include <avtDataObject.h>
#include <avtCellList.h>
class avtCellList;
class avtSamplePointsSource;
class avtVolume;
......@@ -46,6 +46,8 @@ class PIPELINE_API avtSamplePoints : public avtDataObject
void SetNumberOfVariables(int);
int GetNumberOfVariables(void) { return numVars; };
virtual int GetNumberOfCells(void) const
{ return celllist->GetNumberOfCells(); };
void SetVolume(int, int, int);
avtVolume *GetVolume(void) { return volume; };
......
......@@ -2,6 +2,7 @@
// avtDataObjectReader.C //
// ************************************************************************* //
#include <string>
#include <avtDataObjectReader.h>
#include <avtDataSetReader.h>
......@@ -110,6 +111,30 @@ avtDataObjectReader::InputIsNullData(void)
}
// ****************************************************************************
// Method: avtDataObjectReader::InputIs
//
// Purpose:
// Shows if the input type string is equal to given string
//
// Returns: true if the input string and given string match
//
// Programmer: Mark C. Miller
// Creation: January 8, 2003
//
// ****************************************************************************
bool
avtDataObjectReader::InputIs(const char *givenStr)
{
if (!haveInput)
{
EXCEPTION0(NoInputException);
}
return !strcmp(inputTypeStr.c_str(),givenStr);
}
// ****************************************************************************
// Method: avtDataObjectReader::GetImageOutput
//
......@@ -333,7 +358,9 @@ avtDataObjectReader::Read(int size, char *input)
imageReader->GetOutput()->GetInfo().Copy(info);
}
else if (strcmp(dataObjectType, "avtNullData") == 0)
else if ((strcmp(dataObjectType, "avtNullData") == 0) ||
(strcmp(dataObjectType, AVT_NULL_IMAGE_MSG) == 0) ||
(strcmp(dataObjectType, AVT_NULL_DATASET_MSG) == 0))
{
datasetInput = false;
imageInput = false;
......@@ -352,6 +379,7 @@ avtDataObjectReader::Read(int size, char *input)
EXCEPTION0(ImproperUseException);
}
inputTypeStr = std::string(dataObjectType);
delete [] dataObjectType;
if (size != 0)
......
......@@ -5,6 +5,7 @@
#ifndef AVT_DATA_OBJECT_READER_H
#define AVT_DATA_OBJECT_READER_H
#include <pipeline_exports.h>
#include <string>
#include <ref_ptr.h>
......@@ -13,7 +14,6 @@
#include <avtImageReader.h>
#include <avtNullDataReader.h>
// ****************************************************************************
// Class: avtDataObjectReader
//
......@@ -36,6 +36,7 @@ class PIPELINE_API avtDataObjectReader
bool InputIsDataset(void);
bool InputIsImage(void);
bool InputIsNullData(void);
bool InputIs(const char *);
avtDataObject_p GetOutput(void);
avtImage_p GetImageOutput(void);
......@@ -54,6 +55,9 @@ class PIPELINE_API avtDataObjectReader
avtDataSetReader_p datasetReader;
avtImageReader_p imageReader;
avtNullDataReader_p nullDataReader;
private:
std::string inputTypeStr;
};
......
......@@ -39,17 +39,16 @@ avtNullDataSink::avtNullDataSink()
void
avtNullDataSink::SetTypedInput(avtDataObject_p in)
{
if (*in != NULL && strcmp(in->GetType(), "avtNullData") != 0)
if (*in != NULL &&
(strcmp(in->GetType(), "avtNullData") != 0) &&
(strcmp(in->GetType(), AVT_NULL_IMAGE_MSG) != 0) &&
(strcmp(in->GetType(), AVT_NULL_DATASET_MSG) != 0))
{
//
// Should create a new exception here, but I'm under time constraints.
//
debug1 << "Looking for avtNullData, but found type \""
<< in->GetType() << "\"." << endl;
EXCEPTION0(ImproperUseException);
}
CopyTo(input, in);
}
......
......@@ -39,7 +39,6 @@ avtActor::avtActor()
transparencyActor = NULL;
transparencyIndex = -1;
extRenderedImagesActor = NULL;
extRenderedImageId = -1;
}
......@@ -598,7 +597,7 @@ avtActor::SetExternallyRenderedImagesActor(
avtExternallyRenderedImagesActor *actor)
{
extRenderedImagesActor = actor;
extRenderedImageId = drawable->SetExternallyRenderedImagesActor(actor);
drawable->SetExternallyRenderedImagesActor(actor);
}
......
......@@ -109,7 +109,6 @@ class PLOTTER_API avtActor
avtTransparencyActor *transparencyActor;
int transparencyIndex;
avtExternallyRenderedImagesActor *extRenderedImagesActor;
int extRenderedImageId;
vtkRenderer *renderer;
};
......
......@@ -50,9 +50,9 @@ class PLOTTER_API avtDecorationsDrawable : public avtDrawable
virtual void VisibilityOff(void);
virtual int SetTransparencyActor(avtTransparencyActor *)
{ return -1; };
virtual int SetExternallyRenderedImagesActor(
virtual void SetExternallyRenderedImagesActor(
avtExternallyRenderedImagesActor *)
{ return -1; };
{ return; };
virtual void ShiftByVector(const float [3]);
virtual void ScaleByVector(const float [3]);
......
......@@ -69,7 +69,7 @@ class PLOTTER_API avtDrawable
virtual void VisibilityOn(void) = 0;
virtual void VisibilityOff(void) = 0;
virtual int SetTransparencyActor(avtTransparencyActor*) = 0;
virtual int SetExternallyRenderedImagesActor(
virtual void SetExternallyRenderedImagesActor(
avtExternallyRenderedImagesActor*) = 0;
virtual void ShiftByVector(const float [3]) = 0;
......
......@@ -42,7 +42,6 @@ avtExternallyRenderedImagesActor::avtExternallyRenderedImagesActor()
myMapper->SetColorLevel(127);
myActor = vtkActor2D::New();
myActor->SetMapper(myMapper);
lastMat = vtkMatrix4x4::New();
extRenderCallback = NULL;
extRenderCallbackArgs = NULL;
makeExternalRenderRequests = false;
......@@ -69,11 +68,6 @@ avtExternallyRenderedImagesActor::~avtExternallyRenderedImagesActor()
myMapper->Delete();
myMapper = NULL;
}
if (lastMat != NULL)
{
lastMat->Delete();
lastMat= NULL;
}
}
......@@ -128,28 +122,6 @@ avtExternallyRenderedImagesActor::DoExternalRender(avtDataObject_p &dob)
}
// ****************************************************************************
// Method: avtExternallyRenderedImagesActor::AddInput
//
// Purpose:
// Adds information for a plot object that is being externally rendered.
// This method may be called multiple times, once for each plot that is
// externally rendered. The integer returned from this method will serve
// as a handle (id) for the plot within the context of the ERI actor.
//
// Programmer: Mark C. Miller
// Creation: January 9, 2003
// ****************************************************************************
<