Commit 654fef4f authored by hrchilds's avatar hrchilds

Update from September 6, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@317 18c085ea-50e0-402c-830e-de6fd14e8384
parent 008dfbab
......@@ -151,6 +151,9 @@
# Hank Childs, Thu May 6 09:59:30 PDT 2004
# Make the displace operator be required.
#
# Jeremy Meredith, Fri Sep 3 09:47:23 PDT 2004
# Added project operator.
#
##############################################################################
@SET_MAKE@
......@@ -162,8 +165,8 @@ OPTIONAL=Context ConnCompReduce Decimate ExternalSurface \
MetricThreshold RemoveCells Revolve SiloDump SurfCompPrep Tube
REQUIRED=Box Clip Cone Cylinder Displace IndexSelect InverseGhostZone \
Isosurface Isovolume Lineout OnionPeel Reflect Slice SphereSlice \
ThreeSlice Threshold Transform
Isosurface Isovolume Lineout OnionPeel Project Reflect Slice \
SphereSlice ThreeSlice Threshold Transform
SUBDIRS=$(REQUIRED) @OPERATOR_OPTIONAL_DIRS@
ALLSUBDIRS=$(REQUIRED) $(OPTIONAL)
......
<?xml version="1.0"?>
<Plugin name="Project" type="operator" label="Project" version="1.0" enabled="true" iconFile="Project.xpm">
<Attribute name="ProjectAttributes" purpose="Project data from three to two dimensions" persistent="false" exportAPI="" exportInclude="">
<Enum name="ProjectionType">
XYCartesian
ZRCylindrical
</Enum>
<Field name="projectionType" label="projectionType" type="enum" subtype="ProjectionType">
XYCartesian
</Field>
</Attribute>
</Plugin>
/* XPM */
static const char * Project_xpm[] = {
"32 32 76 1",
" c None",
". c #4C4CFF",
"+ c #6565FF",
"@ c #3030FF",
"# c #0000FF",
"$ c #7777FF",
"% c #0000C9",
"& c #0000AA",
"* c #CFF500",
"= c #D9FE0B",
"- c #BEE100",
"; c #A0BE00",
"> c #DBFE19",
", c #FE4BD2",
"' c #FE65D8",
") c #7D9400",
"! c #00B900",
"~ c #FE2FCB",
"{ c #FE00BF",
"] c #FE77DD",
"^ c #6A7E00",
"/ c #C70096",
"( c #A9007F",
"_ c #05BF05",
": c #04BE04",
"< c #02BC02",
"[ c #01BB01",
"} c #10C910",
"| c #0EC70E",
"1 c #0DC60D",
"2 c #0BC50B",
"3 c #1AD21A",
"4 c #18D118",
"5 c #17D017",
"6 c #15CE15",
"7 c #24DC24",
"8 c #23DB23",
"9 c #21D921",
"0 c #20D820",
"a c #2EE62E",
"b c #2DE42D",
"c c #2BE32B",
"d c #2AE22A",
"e c #1ED61E",
"f c #1DD51D",
"g c #1BD41B",
"h c #0AC30A",
"i c #08C208",
"j c #07C007",
"k c #38EF38",
"l c #37EE37",
"m c #36ED36",
"n c #34EB34",
"o c #28E028",
"p c #27DF27",
"q c #25DD25",
"r c #14CD14",
"s c #12CB12",
"t c #11CA11",
"u c #43F943",
"v c #41F841",
"w c #40F640",
"x c #3EF53E",
"y c #33EA33",
"z c #31E831",
"A c #30E730",
"B c #007F00",
"C c #00AA00",
"D c #00D300",
"E c #48FF48",
"F c #63FF63",
"G c #96FF96",
"H c #3BF23B",
"I c #3AF13A",
"J c #46FC46",
"K c #000000",
" ..++ ",
" @##$$+ ",
"#####$$+ ",
"%######. ",
"&######. ",
"&%#####@ **== ",
" &%#### -;;>>= ",
" &&&% ;;;;;>>=",
" ,,'' );;;;;;*",
" !!!! ~{{]]' ^;;;;;;*",
" !!!! {{{{{]]' ^);;;;;-",
" !!!! /{{{{{{, ^);;;; ",
" !!!! ({{{{{{, ^^^) ",
" _:<[ (/{{{{{~ ",
" }|12 (/{{{{ !!!! ",
" 3456 (((/ !!!! ",
" 7890 [!!! ",
" abcd 0efg 2hij ",
" klmn dopq 6rst ",
" uvwx nyzA 0efg ",
"BCCDEEFG BCCDHIFG BCCDpqFG",
" BCDEFG BCDJFG BCDzFG ",
" BCDG BCDG BCDG ",
" BD BD BD ",
" ..++ ,,'' **== ",
" @##$$+ ~{{]]' -;;>>= ",
"#####$$+ {{{{{]]' ;;;;;>>=",
"%######. /{{{{{{, );;;;;;*",
"KK#KK#KK KK{KK{KK,KK KK KK;KK;KK",
"&%#####@ (/{{{{{~ ^);;;;;-",
" &%#### (/{{{{ ^);;;; ",
" &&&% (((/ ^^^) "};
#include <ProjectAttributes.h>
#include <DataNode.h>
//
// Enum conversion methods for ProjectAttributes::ProjectionType
//
static const char *ProjectionType_strings[] = {
"XYCartesian", "ZRCylindrical"};
std::string
ProjectAttributes::ProjectionType_ToString(ProjectAttributes::ProjectionType t)
{
int index = int(t);
if(index < 0 || index >= 2) index = 0;
return ProjectionType_strings[index];
}
std::string
ProjectAttributes::ProjectionType_ToString(int t)
{
int index = (t < 0 || t >= 2) ? 0 : t;
return ProjectionType_strings[index];
}
bool
ProjectAttributes::ProjectionType_FromString(const std::string &s, ProjectAttributes::ProjectionType &val)
{
val = ProjectAttributes::XYCartesian;
for(int i = 0; i < 2; ++i)
{
if(s == ProjectionType_strings[i])
{
val = (ProjectionType)i;
return true;
}
}
return false;
}
// ****************************************************************************
// Method: ProjectAttributes::ProjectAttributes
//
// Purpose:
// Constructor for the ProjectAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 18 14:35:36 PST 2004
//
// Modifications:
//
// ****************************************************************************
ProjectAttributes::ProjectAttributes() : AttributeSubject("i")
{
projectionType = XYCartesian;
}
// ****************************************************************************
// Method: ProjectAttributes::ProjectAttributes
//
// Purpose:
// Copy constructor for the ProjectAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 18 14:35:36 PST 2004
//
// Modifications:
//
// ****************************************************************************
ProjectAttributes::ProjectAttributes(const ProjectAttributes &obj) : AttributeSubject("i")
{
projectionType = obj.projectionType;
SelectAll();
}
// ****************************************************************************
// Method: ProjectAttributes::~ProjectAttributes
//
// Purpose:
// Destructor for the ProjectAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 18 14:35:36 PST 2004
//
// Modifications:
//
// ****************************************************************************
ProjectAttributes::~ProjectAttributes()
{
// nothing here
}
// ****************************************************************************
// Method: ProjectAttributes::operator =
//
// Purpose:
// Assignment operator for the ProjectAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 18 14:35:36 PST 2004
//
// Modifications:
//
// ****************************************************************************
void
ProjectAttributes::operator = (const ProjectAttributes &obj)
{
projectionType = obj.projectionType;
SelectAll();
}
// ****************************************************************************
// Method: ProjectAttributes::operator ==
//
// Purpose:
// Comparison operator == for the ProjectAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 18 14:35:36 PST 2004
//
// Modifications:
//
// ****************************************************************************
bool
ProjectAttributes::operator == (const ProjectAttributes &obj) const
{
// Create the return value
return ((projectionType == obj.projectionType));
}
// ****************************************************************************
// Method: ProjectAttributes::operator !=
//
// Purpose:
// Comparison operator != for the ProjectAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 18 14:35:36 PST 2004
//
// Modifications:
//
// ****************************************************************************
bool
ProjectAttributes::operator != (const ProjectAttributes &obj) const
{
return !(this->operator == (obj));
}
// ****************************************************************************
// Method: ProjectAttributes::TypeName
//
// Purpose:
// Type name method for the ProjectAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 18 14:35:36 PST 2004
//
// Modifications:
//
// ****************************************************************************
const std::string
ProjectAttributes::TypeName() const
{
return "ProjectAttributes";
}
// ****************************************************************************
// Method: ProjectAttributes::CopyAttributes
//
// Purpose:
// CopyAttributes method for the ProjectAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 18 14:35:36 PST 2004
//
// Modifications:
//
// ****************************************************************************
bool
ProjectAttributes::CopyAttributes(const AttributeGroup *atts)
{
if(TypeName() != atts->TypeName())
return false;
// Call assignment operator.
const ProjectAttributes *tmp = (const ProjectAttributes *)atts;
*this = *tmp;
return true;
}
// ****************************************************************************
// Method: ProjectAttributes::CreateCompatible
//
// Purpose:
// CreateCompatible method for the ProjectAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 18 14:35:36 PST 2004
//
// Modifications:
//
// ****************************************************************************
AttributeSubject *
ProjectAttributes::CreateCompatible(const std::string &tname) const
{
AttributeSubject *retval = 0;
if(TypeName() == tname)
retval = new ProjectAttributes(*this);
// Other cases could go here too.
return retval;
}
// ****************************************************************************
// Method: ProjectAttributes::NewInstance
//
// Purpose:
// NewInstance method for the ProjectAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 18 14:35:36 PST 2004
//
// Modifications:
//
// ****************************************************************************
AttributeSubject *
ProjectAttributes::NewInstance(bool copy) const
{
AttributeSubject *retval = 0;
if(copy)
retval = new ProjectAttributes(*this);
else
retval = new ProjectAttributes;
return retval;
}
// ****************************************************************************
// Method: ProjectAttributes::SelectAll
//
// Purpose:
// Selects all attributes.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 18 14:35:36 PST 2004
//
// Modifications:
//
// ****************************************************************************
void
ProjectAttributes::SelectAll()
{
Select(0, (void *)&projectionType);
}
///////////////////////////////////////////////////////////////////////////////
// Set property methods
///////////////////////////////////////////////////////////////////////////////
void
ProjectAttributes::SetProjectionType(ProjectAttributes::ProjectionType projectionType_)
{
projectionType = projectionType_;
Select(0, (void *)&projectionType);
}
///////////////////////////////////////////////////////////////////////////////
// Get property methods
///////////////////////////////////////////////////////////////////////////////
ProjectAttributes::ProjectionType
ProjectAttributes::GetProjectionType() const
{
return ProjectionType(projectionType);
}
///////////////////////////////////////////////////////////////////////////////
// Keyframing methods
///////////////////////////////////////////////////////////////////////////////
// ****************************************************************************
// Method: ProjectAttributes::GetFieldName
//
// Purpose:
// This method returns the name of a field given its index.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 18 14:35:36 PST 2004
//
// Modifications:
//
// ****************************************************************************
std::string
ProjectAttributes::GetFieldName(int index) const
{
switch (index)
{
case 0: return "projectionType";
default: return "invalid index";
}
}
// ****************************************************************************
// Method: ProjectAttributes::GetFieldType
//
// Purpose:
// This method returns the type of a field given its index.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 18 14:35:36 PST 2004
//
// Modifications:
//
// ****************************************************************************
AttributeGroup::FieldType
ProjectAttributes::GetFieldType(int index) const
{
switch (index)
{
case 0: return FieldType_enum;
default: return FieldType_unknown;
}
}
// ****************************************************************************
// Method: ProjectAttributes::GetFieldTypeName
//
// Purpose:
// This method returns the name of a field type given its index.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 18 14:35:36 PST 2004
//
// Modifications:
//
// ****************************************************************************
std::string
ProjectAttributes::GetFieldTypeName(int index) const
{
switch (index)
{
case 0: return "enum";
default: return "invalid index";
}
}
// ****************************************************************************
// Method: ProjectAttributes::FieldsEqual
//
// Purpose:
// This method compares two fields and return true if they are equal.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 18 14:35:36 PST 2004
//
// Modifications:
//
// ****************************************************************************
bool
ProjectAttributes::FieldsEqual(int index_, const AttributeGroup *rhs) const
{
const ProjectAttributes &obj = *((const ProjectAttributes*)rhs);
bool retval = false;
switch (index_)
{
case 0:
{ // new scope
retval = (projectionType == obj.projectionType);
}
break;
default: retval = false;
}
return retval;
}
///////////////////////////////////////////////////////////////////////////////
// User-defined methods.
///////////////////////////////////////////////////////////////////////////////
#ifndef PROJECTATTRIBUTES_H
#define PROJECTATTRIBUTES_H
#include <string>
#include <AttributeSubject.h>
// ****************************************************************************
// Class: ProjectAttributes
//
// Purpose:
// Project data from three to two dimensions
//
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Tue May 18 14:35:36 PST 2004
//
// Modifications:
//
// ****************************************************************************
class ProjectAttributes : public AttributeSubject
{
public:
enum ProjectionType
{
XYCartesian,
ZRCylindrical
};
ProjectAttributes();
ProjectAttributes(const ProjectAttributes &obj);
virtual ~ProjectAttributes();
virtual void operator = (const ProjectAttributes &obj);
virtual bool operator == (const ProjectAttributes &obj) const;
virtual bool operator != (const ProjectAttributes &obj) const;
virtual const std::string TypeName() const;
virtual bool CopyAttributes(const AttributeGroup *);
virtual AttributeSubject *CreateCompatible(const std::string &) const;
virtual AttributeSubject *NewInstance(bool) const;
// Property selection methods
virtual void SelectAll();
// Property setting methods
void SetProjectionType(ProjectionType projectionType_);
// Property getting methods
ProjectionType GetProjectionType() const;
// Enum conversion functions
static std::string ProjectionType_ToString(ProjectionType);
static bool ProjectionType_FromString(const std::string &, ProjectionType &);
protected:
static std::string ProjectionType_ToString(int);
public:
// Keyframing methods
virtual std::string GetFieldName(int index) const;
virtual AttributeGroup::FieldType GetFieldType(int index) const;
virtual std::string GetFieldTypeName(int index) const;
virtual bool FieldsEqual(int index, const AttributeGroup *rhs) const;
private:
int projectionType;
};
#endif
package llnl.visit.operators;
import llnl.visit.AttributeSubject;
import llnl.visit.CommunicationBuffer;
import llnl.visit.Plugin;
// ****************************************************************************