repo migration

This commit is contained in:
2006-09-11 20:19:10 +00:00
commit 41511462f9
167 changed files with 64535 additions and 0 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,470 @@
#include <H5PartRandomSampleAttributes.h>
#include <DataNode.h>
// ****************************************************************************
// Method: H5PartRandomSampleAttributes::H5PartRandomSampleAttributes
//
// Purpose:
// Constructor for the H5PartRandomSampleAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
H5PartRandomSampleAttributes::H5PartRandomSampleAttributes() : AttributeSubject("f")
{
factor = 1;
}
// ****************************************************************************
// Method: H5PartRandomSampleAttributes::H5PartRandomSampleAttributes
//
// Purpose:
// Copy constructor for the H5PartRandomSampleAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
H5PartRandomSampleAttributes::H5PartRandomSampleAttributes(const H5PartRandomSampleAttributes &obj) : AttributeSubject("f")
{
factor = obj.factor;
SelectAll();
}
// ****************************************************************************
// Method: H5PartRandomSampleAttributes::~H5PartRandomSampleAttributes
//
// Purpose:
// Destructor for the H5PartRandomSampleAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
H5PartRandomSampleAttributes::~H5PartRandomSampleAttributes()
{
// nothing here
}
// ****************************************************************************
// Method: H5PartRandomSampleAttributes::operator =
//
// Purpose:
// Assignment operator for the H5PartRandomSampleAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
H5PartRandomSampleAttributes&
H5PartRandomSampleAttributes::operator = (const H5PartRandomSampleAttributes &obj)
{
if (this == &obj) return *this;
factor = obj.factor;
SelectAll();
return *this;
}
// ****************************************************************************
// Method: H5PartRandomSampleAttributes::operator ==
//
// Purpose:
// Comparison operator == for the H5PartRandomSampleAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
bool
H5PartRandomSampleAttributes::operator == (const H5PartRandomSampleAttributes &obj) const
{
// Create the return value
return ((factor == obj.factor));
}
// ****************************************************************************
// Method: H5PartRandomSampleAttributes::operator !=
//
// Purpose:
// Comparison operator != for the H5PartRandomSampleAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
bool
H5PartRandomSampleAttributes::operator != (const H5PartRandomSampleAttributes &obj) const
{
return !(this->operator == (obj));
}
// ****************************************************************************
// Method: H5PartRandomSampleAttributes::TypeName
//
// Purpose:
// Type name method for the H5PartRandomSampleAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
const std::string
H5PartRandomSampleAttributes::TypeName() const
{
return "H5PartRandomSampleAttributes";
}
// ****************************************************************************
// Method: H5PartRandomSampleAttributes::CopyAttributes
//
// Purpose:
// CopyAttributes method for the H5PartRandomSampleAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
bool
H5PartRandomSampleAttributes::CopyAttributes(const AttributeGroup *atts)
{
if(TypeName() != atts->TypeName())
return false;
// Call assignment operator.
const H5PartRandomSampleAttributes *tmp = (const H5PartRandomSampleAttributes *)atts;
*this = *tmp;
return true;
}
// ****************************************************************************
// Method: H5PartRandomSampleAttributes::CreateCompatible
//
// Purpose:
// CreateCompatible method for the H5PartRandomSampleAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
AttributeSubject *
H5PartRandomSampleAttributes::CreateCompatible(const std::string &tname) const
{
AttributeSubject *retval = 0;
if(TypeName() == tname)
retval = new H5PartRandomSampleAttributes(*this);
// Other cases could go here too.
return retval;
}
// ****************************************************************************
// Method: H5PartRandomSampleAttributes::NewInstance
//
// Purpose:
// NewInstance method for the H5PartRandomSampleAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
AttributeSubject *
H5PartRandomSampleAttributes::NewInstance(bool copy) const
{
AttributeSubject *retval = 0;
if(copy)
retval = new H5PartRandomSampleAttributes(*this);
else
retval = new H5PartRandomSampleAttributes;
return retval;
}
// ****************************************************************************
// Method: H5PartRandomSampleAttributes::SelectAll
//
// Purpose:
// Selects all attributes.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
void
H5PartRandomSampleAttributes::SelectAll()
{
Select(0, (void *)&factor);
}
///////////////////////////////////////////////////////////////////////////////
// Persistence methods
///////////////////////////////////////////////////////////////////////////////
// ****************************************************************************
// Method: H5PartRandomSampleAttributes::CreateNode
//
// Purpose:
// This method creates a DataNode representation of the object so it can be saved to a config file.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
bool
H5PartRandomSampleAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
if(parentNode == 0)
return false;
H5PartRandomSampleAttributes defaultObject;
bool addToParent = false;
// Create a node for H5PartRandomSampleAttributes.
DataNode *node = new DataNode("H5PartRandomSampleAttributes");
if(completeSave || !FieldsEqual(0, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("factor", factor));
}
// Add the node to the parent node.
if(addToParent || forceAdd)
parentNode->AddNode(node);
else
delete node;
return (addToParent || forceAdd);
}
// ****************************************************************************
// Method: H5PartRandomSampleAttributes::SetFromNode
//
// Purpose:
// This method sets attributes in this object from values in a DataNode representation of the object.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
void
H5PartRandomSampleAttributes::SetFromNode(DataNode *parentNode)
{
int i;
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("H5PartRandomSampleAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("factor")) != 0)
SetFactor(node->AsFloat());
}
///////////////////////////////////////////////////////////////////////////////
// Set property methods
///////////////////////////////////////////////////////////////////////////////
void
H5PartRandomSampleAttributes::SetFactor(float factor_)
{
factor = factor_;
Select(0, (void *)&factor);
}
///////////////////////////////////////////////////////////////////////////////
// Get property methods
///////////////////////////////////////////////////////////////////////////////
float
H5PartRandomSampleAttributes::GetFactor() const
{
return factor;
}
///////////////////////////////////////////////////////////////////////////////
// Keyframing methods
///////////////////////////////////////////////////////////////////////////////
// ****************************************************************************
// Method: H5PartRandomSampleAttributes::GetFieldName
//
// Purpose:
// This method returns the name of a field given its index.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
std::string
H5PartRandomSampleAttributes::GetFieldName(int index) const
{
switch (index)
{
case 0: return "factor";
default: return "invalid index";
}
}
// ****************************************************************************
// Method: H5PartRandomSampleAttributes::GetFieldType
//
// Purpose:
// This method returns the type of a field given its index.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
AttributeGroup::FieldType
H5PartRandomSampleAttributes::GetFieldType(int index) const
{
switch (index)
{
case 0: return FieldType_float;
default: return FieldType_unknown;
}
}
// ****************************************************************************
// Method: H5PartRandomSampleAttributes::GetFieldTypeName
//
// Purpose:
// This method returns the name of a field type given its index.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
std::string
H5PartRandomSampleAttributes::GetFieldTypeName(int index) const
{
switch (index)
{
case 0: return "float";
default: return "invalid index";
}
}
// ****************************************************************************
// Method: H5PartRandomSampleAttributes::FieldsEqual
//
// Purpose:
// This method compares two fields and return true if they are equal.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
bool
H5PartRandomSampleAttributes::FieldsEqual(int index_, const AttributeGroup *rhs) const
{
const H5PartRandomSampleAttributes &obj = *((const H5PartRandomSampleAttributes*)rhs);
bool retval = false;
switch (index_)
{
case 0:
{ // new scope
retval = (factor == obj.factor);
}
break;
default: retval = false;
}
return retval;
}
///////////////////////////////////////////////////////////////////////////////
// User-defined methods.
///////////////////////////////////////////////////////////////////////////////
@@ -0,0 +1,60 @@
#ifndef H5PARTRANDOMSAMPLEATTRIBUTES_H
#define H5PARTRANDOMSAMPLEATTRIBUTES_H
#include <AttributeSubject.h>
// ****************************************************************************
// Class: H5PartRandomSampleAttributes
//
// Purpose:
// Randomly reduce an H5Part point mesh
//
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
class H5PartRandomSampleAttributes : public AttributeSubject
{
public:
H5PartRandomSampleAttributes();
H5PartRandomSampleAttributes(const H5PartRandomSampleAttributes &obj);
virtual ~H5PartRandomSampleAttributes();
virtual H5PartRandomSampleAttributes& operator = (const H5PartRandomSampleAttributes &obj);
virtual bool operator == (const H5PartRandomSampleAttributes &obj) const;
virtual bool operator != (const H5PartRandomSampleAttributes &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 SetFactor(float factor_);
// Property getting methods
float GetFactor() const;
// Persistence methods
virtual bool CreateNode(DataNode *node, bool completeSave, bool forceAdd);
virtual void SetFromNode(DataNode *node);
// 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:
float factor;
};
#endif
@@ -0,0 +1,76 @@
package llnl.visit.operators;
import llnl.visit.AttributeSubject;
import llnl.visit.CommunicationBuffer;
import llnl.visit.Plugin;
// ****************************************************************************
// Class: H5PartRandomSampleAttributes
//
// Purpose:
// Randomly reduce an H5Part point mesh
//
// Notes: Autogenerated by xml2java.
//
// Programmer: xml2java
// Creation: Thu Mar 16 10:26:56 PDT 2006
//
// Modifications:
//
// ****************************************************************************
public class H5PartRandomSampleAttributes extends AttributeSubject implements Plugin
{
public H5PartRandomSampleAttributes()
{
super(1);
factor = 1f;
}
public H5PartRandomSampleAttributes(H5PartRandomSampleAttributes obj)
{
super(1);
factor = obj.factor;
SelectAll();
}
public boolean equals(H5PartRandomSampleAttributes obj)
{
// Create the return value
return ((factor == obj.factor));
}
public String GetName() { return "H5PartRandomSample"; }
public String GetVersion() { return "1.0"; }
// Property setting methods
public void SetFactor(float factor_)
{
factor = factor_;
Select(0);
}
// Property getting methods
public float GetFactor() { return factor; }
// Write and read methods.
public void WriteAtts(CommunicationBuffer buf)
{
if(WriteSelect(0, buf))
buf.WriteFloat(factor);
}
public void ReadAtts(int n, CommunicationBuffer buf)
{
buf.ReadByte();
SetFactor(buf.ReadFloat());
}
// Attributes
private float factor;
}
@@ -0,0 +1,47 @@
// ************************************************************************* //
// File: H5PartRandomSampleCommonPluginInfo.C
// ************************************************************************* //
#include <H5PartRandomSamplePluginInfo.h>
#include <H5PartRandomSampleAttributes.h>
// ****************************************************************************
// Method: H5PartRandomSampleCommonPluginInfo::AllocAttributes
//
// Purpose:
// Return a pointer to a newly allocated attribute subject.
//
// Returns: A pointer to the newly allocated attribute subject.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// ****************************************************************************
AttributeSubject *
H5PartRandomSampleCommonPluginInfo::AllocAttributes()
{
return new H5PartRandomSampleAttributes;
}
// ****************************************************************************
// Method: H5PartRandomSampleCommonPluginInfo::CopyAttributes
//
// Purpose:
// Copy a H5PartRandomSample attribute subject.
//
// Arguments:
// to The destination attribute subject.
// from The source attribute subject.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// ****************************************************************************
void
H5PartRandomSampleCommonPluginInfo::CopyAttributes(AttributeSubject *to,
AttributeSubject *from)
{
*((H5PartRandomSampleAttributes *) to) = *((H5PartRandomSampleAttributes *) from);
}
@@ -0,0 +1,44 @@
// ************************************************************************* //
// File: H5PartRandomSampleEnginePluginInfo.C
// ************************************************************************* //
#include <H5PartRandomSamplePluginInfo.h>
#include <avtH5PartRandomSampleFilter.h>
#if defined(__APPLE__)
#define GetEngineInfo H5PartRandomSample_GetEngineInfo
#endif
// ****************************************************************************
// Function: GetEngineInfo
//
// Purpose:
// Return a new EnginePluginInfo for the H5PartRandomSample operator.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// ****************************************************************************
extern "C" EngineOperatorPluginInfo* GetEngineInfo()
{
return new H5PartRandomSampleEnginePluginInfo;
}
// ****************************************************************************
// Method: H5PartRandomSampleEnginePluginInfo::AllocAvtPluginFilter
//
// Purpose:
// Return a pointer to a newly allocated avtPluginFilter.
//
// Returns: A pointer to the newly allocated avtPluginFilter.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// ****************************************************************************
avtPluginFilter *
H5PartRandomSampleEnginePluginInfo::AllocAvtPluginFilter()
{
return new avtH5PartRandomSampleFilter;
}
@@ -0,0 +1,92 @@
// ************************************************************************* //
// File: H5PartRandomSampleGUIPluginInfo.C
// ************************************************************************* //
#include <H5PartRandomSamplePluginInfo.h>
#include <H5PartRandomSampleAttributes.h>
#include <QvisH5PartRandomSampleWindow.h>
#if defined(__APPLE__)
#define GetGUIInfo H5PartRandomSample_GetGUIInfo
#endif
// ****************************************************************************
// Function: GetGUIInfo
//
// Purpose:
// Return a new GUIPluginInfo for the H5PartRandomSample operator.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:29:14 PDT 2006
//
// ****************************************************************************
extern "C" GUIOperatorPluginInfo* GetGUIInfo()
{
return new H5PartRandomSampleGUIPluginInfo;
}
// ****************************************************************************
// Method: H5PartRandomSampleGUIPluginInfo::GetMenuName
//
// Purpose:
// Return a pointer to the name to use in the GUI menu.
//
// Returns: A pointer to the name to use in the GUI menu.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:29:14 PDT 2006
//
// ****************************************************************************
const char *
H5PartRandomSampleGUIPluginInfo::GetMenuName() const
{
return "H5PartRandomSample";
}
// ****************************************************************************
// Method: H5PartRandomSampleGUIPluginInfo::CreatePluginWindow
//
// Purpose:
// Return a pointer to an operator's attribute window.
//
// Arguments:
// type The type of the operator.
// attr The attribute subject for the operator.
// notepad The notepad to use for posting the window.
//
// Returns: A pointer to the operator's attribute window.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:29:14 PDT 2006
//
// ****************************************************************************
QvisPostableWindowObserver *
H5PartRandomSampleGUIPluginInfo::CreatePluginWindow(int type, AttributeSubject *attr,
QvisNotepadArea *notepad)
{
return new QvisH5PartRandomSampleWindow(type, (H5PartRandomSampleAttributes *)attr,
"H5PartRandomSample operator attributes", "H5PartRandomSample operator", notepad);
}
// ****************************************************************************
// Method: H5PartRandomSampleGUIPluginInfo::XPMIconData
//
// Purpose:
// Return a pointer to the icon data.
//
// Returns: A pointer to the icon data.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:29:14 PDT 2006
//
// ****************************************************************************
#include <icon.xpm>
const char **
H5PartRandomSampleGUIPluginInfo::XPMIconData() const
{
return icon_xpm;
}
@@ -0,0 +1,107 @@
// ************************************************************************* //
// File: H5PartRandomSamplePluginInfo.C
// ************************************************************************* //
#include <H5PartRandomSamplePluginInfo.h>
#include <H5PartRandomSampleAttributes.h>
#include <visit-config.h>
#if defined(__APPLE__)
extern "C" const char *H5PartRandomSampleVisItPluginVersion = VERSION;
#else
extern "C" const char *VisItPluginVersion = VERSION;
#endif
#if defined(__APPLE__)
#define GetGeneralInfo H5PartRandomSample_GetGeneralInfo
#endif
// ****************************************************************************
// Function: GetGeneralInfo
//
// Purpose:
// Return a new GeneralPluginInfo for the H5PartRandomSample operator.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// ****************************************************************************
extern "C" GeneralOperatorPluginInfo* GetGeneralInfo()
{
return new H5PartRandomSampleGeneralPluginInfo;
}
// ****************************************************************************
// Method: H5PartRandomSampleGeneralPluginInfo::GetName
//
// Purpose:
// Return the name of the operator plugin.
//
// Returns: A pointer to the name of the operator plugin.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// ****************************************************************************
char *
H5PartRandomSampleGeneralPluginInfo::GetName() const
{
return "H5PartRandomSample";
}
// ****************************************************************************
// Method: H5PartRandomSampleGeneralPluginInfo::GetVersion
//
// Purpose:
// Return the version of the operator plugin.
//
// Returns: A pointer to the version of the operator plugin.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// ****************************************************************************
char *
H5PartRandomSampleGeneralPluginInfo::GetVersion() const
{
return "1.0";
}
// ****************************************************************************
// Method: H5PartRandomSampleGeneralPluginInfo::GetID
//
// Purpose:
// Return the id of the operator plugin.
//
// Returns: A pointer to the id of the operator plugin.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// ****************************************************************************
char *
H5PartRandomSampleGeneralPluginInfo::GetID() const
{
return "H5PartRandomSample_1.0";
}
// ****************************************************************************
// Method: H5PartRandomSampleGeneralPluginInfo::EnabledByDefault
//
// Purpose:
// Return true if this plugin should be enabled by default; false otherwise.
//
// Returns: true/false
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// ****************************************************************************
bool
H5PartRandomSampleGeneralPluginInfo::EnabledByDefault() const
{
return true;
}
@@ -0,0 +1,85 @@
// ************************************************************************* //
// File: H5PartRandomSamplePluginInfo.h
// ************************************************************************* //
#ifndef H5PARTRANDOMSAMPLE_PLUGIN_INFO_H
#define H5PARTRANDOMSAMPLE_PLUGIN_INFO_H
#include <OperatorPluginInfo.h>
#include <operator_plugin_exports.h>
class H5PartRandomSampleAttributes;
// ****************************************************************************
// Class: H5PartRandomSamplePluginInfo
//
// Purpose:
// Five classes that provide all the information about an H5PartRandomSample operator
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
class H5PartRandomSampleGeneralPluginInfo : public virtual GeneralOperatorPluginInfo
{
public:
virtual char *GetName() const;
virtual char *GetVersion() const;
virtual char *GetID() const;
virtual bool EnabledByDefault() const;
};
class H5PartRandomSampleCommonPluginInfo : public virtual CommonOperatorPluginInfo, public virtual H5PartRandomSampleGeneralPluginInfo
{
public:
virtual AttributeSubject *AllocAttributes();
virtual void CopyAttributes(AttributeSubject *to, AttributeSubject *from);
};
class H5PartRandomSampleGUIPluginInfo : public virtual GUIOperatorPluginInfo, public virtual H5PartRandomSampleCommonPluginInfo
{
public:
virtual const char *GetMenuName() const;
virtual QvisPostableWindowObserver *CreatePluginWindow(int type,
AttributeSubject *attr, QvisNotepadArea *notepad);
virtual const char **XPMIconData() const;
};
class H5PartRandomSampleViewerPluginInfo : public virtual ViewerOperatorPluginInfo, public virtual H5PartRandomSampleCommonPluginInfo
{
public:
virtual AttributeSubject *GetClientAtts();
virtual AttributeSubject *GetDefaultAtts();
virtual void SetClientAtts(AttributeSubject *atts);
virtual void GetClientAtts(AttributeSubject *atts);
virtual void InitializeOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot,
const bool fromDefault);
virtual const char **XPMIconData() const;
static void InitializeGlobalObjects();
private:
static H5PartRandomSampleAttributes *defaultAtts;
static H5PartRandomSampleAttributes *clientAtts;
};
class H5PartRandomSampleEnginePluginInfo : public virtual EngineOperatorPluginInfo, public virtual H5PartRandomSampleCommonPluginInfo
{
public:
virtual avtPluginFilter *AllocAvtPluginFilter();
};
class H5PartRandomSampleScriptingPluginInfo : public virtual ScriptingOperatorPluginInfo, public virtual H5PartRandomSampleCommonPluginInfo
{
public:
virtual void InitializePlugin(AttributeSubject *subj, void *data);
virtual void *GetMethodTable(int *nMethods);
virtual bool TypesMatch(void *pyobject);
virtual char *GetLogString();
virtual void SetDefaults(const AttributeSubject *atts);
};
#endif
@@ -0,0 +1,142 @@
// ************************************************************************* //
// H5PartRandomSampleScriptingPluginInfo.C
// ************************************************************************* //
#include <H5PartRandomSamplePluginInfo.h>
#include <PyH5PartRandomSampleAttributes.h>
#if defined(__APPLE__)
#define GetScriptingInfo H5PartRandomSample_GetScriptingInfo
#endif
// ****************************************************************************
// Function: GetScriptingInfo
//
// Purpose:
// Return a new ScriptingPluginInfo for the H5PartRandomSample plot.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// ****************************************************************************
extern "C" ScriptingOperatorPluginInfo* GetScriptingInfo()
{
return new H5PartRandomSampleScriptingPluginInfo;
}
// ****************************************************************************
// Method: H5PartRandomSampleScriptingPluginInfo::InitializePlugin
//
// Purpose:
// Calls the initialization function for the plugin.
//
// Arguments:
// subj : A pointer to the plugin's state object.
// data : A pointer to data to be used by the observer function.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
void
H5PartRandomSampleScriptingPluginInfo::InitializePlugin(AttributeSubject *subj,
void *data)
{
PyH5PartRandomSampleAttributes_StartUp((H5PartRandomSampleAttributes *)subj, data);
}
// ****************************************************************************
// Method: H5PartRandomSampleScriptingPluginInfo::GetMethodTable
//
// Purpose:
// Returns a pointer to the plugin's Python method table. These methods are
// added to the top-level visit module's methods.
//
// Arguments:
// nMethods : Returns the number of methods in the method table.
//
// Returns: A pointer to the method table.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
void *
H5PartRandomSampleScriptingPluginInfo::GetMethodTable(int *nMethods)
{
return PyH5PartRandomSampleAttributes_GetMethodTable(nMethods);
}
// ****************************************************************************
// Method: H5PartRandomSampleScriptingPluginInfo::TypesMatch
//
// Purpose:
// Returns whether or not the input PyObject is H5PartRandomSample plot attributes.
//
// Arguments:
// pyobject : A PyObject cast to void*.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
bool
H5PartRandomSampleScriptingPluginInfo::TypesMatch(void *pyobject)
{
return PyH5PartRandomSampleAttributes_Check((PyObject *)pyobject);
}
// ****************************************************************************
// Method: H5PartRandomSampleScriptingPluginInfo::GetLogString
//
// Purpose:
// Gets a string representation of the current attributes.
//
// Arguments:
// val : Whether or not to log state information.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
char *
H5PartRandomSampleScriptingPluginInfo::GetLogString()
{
std::string s(PyH5PartRandomSampleAttributes_GetLogString());
char *v = new char[s.size() + 1];
strcpy(v, s.c_str());
return v;
}
// ****************************************************************************
// Method: H5PartRandomSampleScriptingPluginInfo::SetDefaults
//
// Purpose:
// Used to set the default values for a plugin's state object.
//
// Arguments:
// atts : The new state.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
void
H5PartRandomSampleScriptingPluginInfo::SetDefaults(const AttributeSubject *atts)
{
PyH5PartRandomSampleAttributes_SetDefaults((const H5PartRandomSampleAttributes *)atts);
}
@@ -0,0 +1,175 @@
// ************************************************************************* //
// File: H5PartRandomSampleViewerPluginInfo.C
// ************************************************************************* //
#include <H5PartRandomSamplePluginInfo.h>
#include <H5PartRandomSampleAttributes.h>
#if defined(__APPLE__)
#define GetViewerInfo H5PartRandomSample_GetViewerInfo
#endif
// ****************************************************************************
// Function: GetViewerInfo
//
// Purpose:
// Return a new ViewerPluginInfo for the H5PartRandomSample operator.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// ****************************************************************************
extern "C" ViewerOperatorPluginInfo* GetViewerInfo()
{
H5PartRandomSampleViewerPluginInfo::InitializeGlobalObjects();
return new H5PartRandomSampleViewerPluginInfo;
}
//
// Storage for static data elements.
//
H5PartRandomSampleAttributes *H5PartRandomSampleViewerPluginInfo::clientAtts = NULL;
H5PartRandomSampleAttributes *H5PartRandomSampleViewerPluginInfo::defaultAtts = NULL;
// ****************************************************************************
// Method: H5PartRandomSampleViewerPluginInfo::InitializeGlobalObjects
//
// Purpose:
// Initialize the operator atts.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// ****************************************************************************
void
H5PartRandomSampleViewerPluginInfo::InitializeGlobalObjects()
{
H5PartRandomSampleViewerPluginInfo::clientAtts = new H5PartRandomSampleAttributes;
H5PartRandomSampleViewerPluginInfo::defaultAtts = new H5PartRandomSampleAttributes;
}
// ****************************************************************************
// Method: H5PartRandomSampleViewerPluginInfo::GetClientAtts
//
// Purpose:
// Return a pointer to the viewer client attributes.
//
// Returns: A pointer to the viewer client attributes.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// ****************************************************************************
AttributeSubject *
H5PartRandomSampleViewerPluginInfo::GetClientAtts()
{
return clientAtts;
}
// ****************************************************************************
// Method: H5PartRandomSampleViewerPluginInfo::GetDefaultAtts
//
// Purpose:
// Return a pointer to the viewer default attributes.
//
// Returns: A pointer to the viewer default attributes.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// ****************************************************************************
AttributeSubject *
H5PartRandomSampleViewerPluginInfo::GetDefaultAtts()
{
return defaultAtts;
}
// ****************************************************************************
// Method: H5PartRandomSampleViewerPluginInfo::SetClientAtts
//
// Purpose:
// Set the viewer client attributes.
//
// Arguments:
// atts A pointer to the new client attributes.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// ****************************************************************************
void
H5PartRandomSampleViewerPluginInfo::SetClientAtts(AttributeSubject *atts)
{
*clientAtts = *(H5PartRandomSampleAttributes *)atts;
clientAtts->Notify();
}
// ****************************************************************************
// Method: H5PartRandomSampleViewerPluginInfo::GetClientAtts
//
// Purpose:
// Get the viewer client attributes.
//
// Arguments:
// atts A pointer to return the client default attributes in.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// ****************************************************************************
void
H5PartRandomSampleViewerPluginInfo::GetClientAtts(AttributeSubject *atts)
{
*(H5PartRandomSampleAttributes *)atts = *clientAtts;
}
// ****************************************************************************
// Method: H5PartRandomSampleViewerPluginInfo::InitializeOperatorAtts
//
// Purpose:
// Initialize the operator attributes to the default attributes.
//
// Arguments:
// atts The attribute subject to initialize.
// md The metadata used to initialize.
// atts The variable name used to initialize.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// ****************************************************************************
void
H5PartRandomSampleViewerPluginInfo::InitializeOperatorAtts(AttributeSubject *atts,
const ViewerPlot *plot,
const bool fromDefault)
{
if (fromDefault)
*(H5PartRandomSampleAttributes*)atts = *defaultAtts;
else
*(H5PartRandomSampleAttributes*)atts = *clientAtts;
}
// ****************************************************************************
// Method: H5PartRandomSampleViewerPluginInfo::XPMIconData
//
// Purpose:
// Return a pointer to the icon data.
//
// Returns: A pointer to the icon data.
//
// Programmer: cristina -- generated by xml2info
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// ****************************************************************************
#include <icon.xpm>
const char **
H5PartRandomSampleViewerPluginInfo::XPMIconData() const
{
return icon_xpm;
}
@@ -0,0 +1,113 @@
##
## Programs and options...
##
include /usr/local/visit/visit-1.5.1/1.5.1/linux-x86_64/include/make-variables
TOPDIR=/usr/local/visit/visit-1.5.1/1.5.1/linux-x86_64
##
## Libraries and includes...
##
VTK_INCLUDE= \
-I/usr/local/visit/visit-1.5.1/1.5.1/linux-x86_64/include/vtk \
-I/usr/local/visit/visit-1.5.1/1.5.1/linux-x86_64/include/vtk/Common \
-I/usr/local/visit/visit-1.5.1/1.5.1/linux-x86_64/include/vtk/Filtering \
-I/usr/local/visit/visit-1.5.1/1.5.1/linux-x86_64/include/vtk/Graphics \
-I/usr/local/visit/visit-1.5.1/1.5.1/linux-x86_64/include/vtk/Hybrid \
-I/usr/local/visit/visit-1.5.1/1.5.1/linux-x86_64/include/vtk/IO \
-I/usr/local/visit/visit-1.5.1/1.5.1/linux-x86_64/include/vtk/Imaging \
-I/usr/local/visit/visit-1.5.1/1.5.1/linux-x86_64/include/vtk/Rendering
MOC=/usr/local/visit/visit-1.5.1/1.5.1/linux-x86_64/bin/moc
CXXFLAGS=$(CXXFLAGSORIG) $(QT_CXXFLAGS) $(PY_CXXFLAGS)
CPPFLAGS=$(CPPFLAGSORIG) $(VTK_INCLUDE) -I. -I/usr/local/visit/visit-1.5.1/1.5.1/linux-x86_64/include -I/usr/local/visit/visit-1.5.1/1.5.1/linux-x86_64/include/visit
LDFLAGS=$(LDFLAGSORIG) $(PY_LDFLAGS) -L/d/visusers/cristina/.visit/linux-x86_64/plugins/operators
##
## Files...
##
PLUGINDIR=operators
PLUGINNAME=H5PartRandomSampleOperator
WIDGETS=QvisH5PartRandomSampleWindow.h
ISRC=H5PartRandomSamplePluginInfo.C
COMMONSRC=H5PartRandomSamplePluginInfo.C H5PartRandomSampleCommonPluginInfo.C H5PartRandomSampleAttributes.C
GSRC=H5PartRandomSampleGUIPluginInfo.C QvisH5PartRandomSampleWindow.C
VSRC=H5PartRandomSampleViewerPluginInfo.C
ESRC=H5PartRandomSampleEnginePluginInfo.C avtH5PartRandomSampleFilter.C
SSRC=H5PartRandomSampleScriptingPluginInfo.C PyH5PartRandomSampleAttributes.C
SRC=$(ISRC) $(COMMONSRC) $(GSRC) $(VSRC) $(ESRC) $(SSRC)
JAVASRC=H5PartRandomSampleAttributes.java
JAVAOBJ=/usr/local/visit/visit-1.5.1/1.5.1/linux-x86_64/java/llnl/visit/operators/H5PartRandomSampleAttributes.class
JAVAPLUGINFLAGS=-d /usr/local/visit/visit-1.5.1/1.5.1/linux-x86_64/java -classpath /usr/local/visit/visit-1.5.1/1.5.1/linux-x86_64/java
SHLIB_FORCED=
ELIBS_FOR_MACOSX_PREBINDING=$(BZIP2_LIBS)
VLIBS_FOR_MACOSX_PREBINDING=$(BZIP2_LIBS)
ILIBS=
GLIBS=-lgui -lmdserverproxy -lviewerproxy -lproxybase -lmdserverrpc -lviewerrpc -lwinutil -ldbatts -lavtexceptions -lstate -lcomm -lmisc -lplugin -lexpr -lparser -lutility -lI$(PLUGINNAME) $(QT_LDFLAGS) $(QT_LIBS) $(QUI_LIBS) $(X_LIBS)
SLIBS=-lstate -lmisc -lcomm -lutility $(PY_LIB) -lI$(PLUGINNAME)
VLIBS=-lpipeline_ser -lplotter_ser -lavtfilters_ser -lavtmath_ser -lavtview -ldbatts -lavtexceptions -lstate -lmisc -lcomm -lexpr -lparser -lutility -lvisit_vtk -llightweight_visit_vtk -lparallel_visit_vtk_ser $(VLIBS_FOR_MACOSX_PREBINDING) -lI$(PLUGINNAME) $(VTK_LIBS)
ESERLIBS=-lpipeline_ser -lplotter_ser -lavtfilters_ser -lavtmath_ser -lavtview -ldbatts -lavtexceptions -lstate -lmisc -lcomm -lexpr -lparser -lutility -lvisit_vtk -llightweight_visit_vtk -lparallel_visit_vtk_ser -lI$(PLUGINNAME) $(ELIBS_FOR_MACOSX_PREBINDING) $(VTK_LIBS)
EPARLIBS=-lpipeline_par -lplotter_par -lavtfilters_par -lavtmath_par -lavtview -ldbatts -lavtexceptions -lstate -lmisc -lcomm -lexpr -lparser -lutility -lvisit_vtk -llightweight_visit_vtk -lparallel_visit_vtk_par -lI$(PLUGINNAME) $(ELIBS_FOR_MACOSX_PREBINDING) $(VTK_LIBS) $(SHLIB_MPI_LIBS)
IDSO=/d/visusers/cristina/.visit/linux-x86_64/plugins/operators/libIH5PartRandomSampleOperator.so
GDSO=/d/visusers/cristina/.visit/linux-x86_64/plugins/operators/libGH5PartRandomSampleOperator.so
SDSO=/d/visusers/cristina/.visit/linux-x86_64/plugins/operators/libSH5PartRandomSampleOperator.so
VDSO=/d/visusers/cristina/.visit/linux-x86_64/plugins/operators/libVH5PartRandomSampleOperator.so
ESERDSO=/d/visusers/cristina/.visit/linux-x86_64/plugins/operators/libEH5PartRandomSampleOperator_ser.so
EPARDSO=/d/visusers/cristina/.visit/linux-x86_64/plugins/operators/libEH5PartRandomSampleOperator_par.so
DISTRIB=
##
## Derived objects
##
IOBJ=$(ISRC:.C=.o)
GOBJ=$(COMMONSRC:.C=.o) $(GSRC:.C=.o)
SOBJ=$(COMMONSRC:.C=.o) $(SSRC:.C=.o)
VOBJ=$(COMMONSRC:.C=.o) $(VSRC:.C=.o)
MOBJ=$(COMMONSRC:.C=.o) $(MSRC:.C=.o) $(MSPECIFICSRC:.C=_mds.o)
ESEROBJ=$(COMMONSRC:.C=.o) $(ESRC:.C=.o)
EPAROBJ=$(COMMONSRC:.C=.o) $(ESRC:.C=_par.o)
MOCSRC = $(WIDGETS:.h=_moc.C)
MOCOBJ = $(MOCSRC:.C=.o)
##
## Standard targets...
##
all: message $(IDSO) $(GUILIB) $(VIEWERLIB) $(ENGINELIBSER) $(ENGINELIBPAR) $(SCRIPTINGLIB) $(JAVACLASS)
clean:
$(RM) $(IOBJ) $(COMMONOBJ)
$(RM) $(GOBJ) $(SOBJ) $(VOBJ) $(MOBJ) $(ESEROBJ) $(EPAROBJ)
$(RM) $(MOCSRC) $(MOCOBJ)
$(RM) $(IDSO) $(GDSO) $(SDSO) $(VDSO) $(MDSO) $(ESERDSO) $(EPARDSO)
$(RM) $(JAVAOBJ)
##
## Other targets...
##
message:
@echo
@echo "****************************************************************************"
@echo "*** Building H5PartRandomSample Operator Plugin"
@echo "****************************************************************************"
##
## moc
##
$(MOCSRC) or_no_widgets: $(WIDGETS)
@rm -f $@
$(MOC) $(@:_moc.C=.h) > $@
##
## Automatic dependency stuff
##
include /usr/local/visit/visit-1.5.1/1.5.1/linux-x86_64/include/make-targets
@@ -0,0 +1,358 @@
#include <PyH5PartRandomSampleAttributes.h>
#include <ObserverToCallback.h>
#include <ColorAttribute.h>
#include <snprintf.h>
// ****************************************************************************
// Module: PyH5PartRandomSampleAttributes
//
// Purpose:
// Randomly reduce an H5Part point mesh
//
// Note: Autogenerated by xml2python. Do not modify by hand!
//
// Programmer: xml2python
// Creation: Thu Mar 16 10:26:56 PDT 2006
//
// ****************************************************************************
//
// This struct contains the Python type information and a H5PartRandomSampleAttributes.
//
struct H5PartRandomSampleAttributesObject
{
PyObject_HEAD
H5PartRandomSampleAttributes *data;
bool owns;
};
//
// Internal prototypes
//
static PyObject *NewH5PartRandomSampleAttributes(int);
std::string
PyH5PartRandomSampleAttributes_ToString(const H5PartRandomSampleAttributes *atts, const char *prefix)
{
std::string str;
char tmpStr[1000];
SNPRINTF(tmpStr, 1000, "%sfactor = %g\n", prefix, atts->GetFactor());
str += tmpStr;
return str;
}
static PyObject *
H5PartRandomSampleAttributes_Notify(PyObject *self, PyObject *args)
{
H5PartRandomSampleAttributesObject *obj = (H5PartRandomSampleAttributesObject *)self;
obj->data->Notify();
Py_INCREF(Py_None);
return Py_None;
}
static PyObject *
H5PartRandomSampleAttributes_SetFactor(PyObject *self, PyObject *args)
{
H5PartRandomSampleAttributesObject *obj = (H5PartRandomSampleAttributesObject *)self;
float fval;
if(!PyArg_ParseTuple(args, "f", &fval))
return NULL;
// Set the factor in the object.
obj->data->SetFactor(fval);
Py_INCREF(Py_None);
return Py_None;
}
static PyObject *
H5PartRandomSampleAttributes_GetFactor(PyObject *self, PyObject *args)
{
H5PartRandomSampleAttributesObject *obj = (H5PartRandomSampleAttributesObject *)self;
PyObject *retval = PyFloat_FromDouble(double(obj->data->GetFactor()));
return retval;
}
static struct PyMethodDef H5PartRandomSampleAttributes_methods[] = {
{"Notify", H5PartRandomSampleAttributes_Notify, METH_VARARGS},
{"SetFactor", H5PartRandomSampleAttributes_SetFactor, METH_VARARGS},
{"GetFactor", H5PartRandomSampleAttributes_GetFactor, METH_VARARGS},
{NULL, NULL}
};
//
// Type functions
//
static void
H5PartRandomSampleAttributes_dealloc(PyObject *v)
{
H5PartRandomSampleAttributesObject *obj = (H5PartRandomSampleAttributesObject *)v;
if(obj->owns)
delete obj->data;
}
static int
H5PartRandomSampleAttributes_compare(PyObject *v, PyObject *w)
{
H5PartRandomSampleAttributes *a = ((H5PartRandomSampleAttributesObject *)v)->data;
H5PartRandomSampleAttributes *b = ((H5PartRandomSampleAttributesObject *)w)->data;
return (*a == *b) ? 0 : -1;
}
static PyObject *
H5PartRandomSampleAttributes_getattr(PyObject *self, char *name)
{
if(strcmp(name, "factor") == 0)
return H5PartRandomSampleAttributes_GetFactor(self, NULL);
return Py_FindMethod(H5PartRandomSampleAttributes_methods, self, name);
}
static int
H5PartRandomSampleAttributes_setattr(PyObject *self, char *name, PyObject *args)
{
// Create a tuple to contain the arguments since all of the Set
// functions expect a tuple.
PyObject *tuple = PyTuple_New(1);
PyTuple_SET_ITEM(tuple, 0, args);
Py_INCREF(args);
bool retval = false;
if(strcmp(name, "factor") == 0)
retval = (H5PartRandomSampleAttributes_SetFactor(self, tuple) != NULL);
Py_DECREF(tuple);
return retval ? 0 : -1;
}
static int
H5PartRandomSampleAttributes_print(PyObject *v, FILE *fp, int flags)
{
H5PartRandomSampleAttributesObject *obj = (H5PartRandomSampleAttributesObject *)v;
fprintf(fp, "%s", PyH5PartRandomSampleAttributes_ToString(obj->data, "").c_str());
return 0;
}
PyObject *
H5PartRandomSampleAttributes_str(PyObject *v)
{
H5PartRandomSampleAttributesObject *obj = (H5PartRandomSampleAttributesObject *)v;
return PyString_FromString(PyH5PartRandomSampleAttributes_ToString(obj->data,"").c_str());
}
//
// The doc string for the class.
//
static char *H5PartRandomSampleAttributes_Purpose = "Randomly reduce an H5Part point mesh";
//
// The type description structure
//
static PyTypeObject H5PartRandomSampleAttributesType =
{
//
// Type header
//
PyObject_HEAD_INIT(&PyType_Type)
0, // ob_size
"H5PartRandomSampleAttributes", // tp_name
sizeof(H5PartRandomSampleAttributesObject), // tp_basicsize
0, // tp_itemsize
//
// Standard methods
//
(destructor)H5PartRandomSampleAttributes_dealloc, // tp_dealloc
(printfunc)H5PartRandomSampleAttributes_print, // tp_print
(getattrfunc)H5PartRandomSampleAttributes_getattr, // tp_getattr
(setattrfunc)H5PartRandomSampleAttributes_setattr, // tp_setattr
(cmpfunc)H5PartRandomSampleAttributes_compare, // tp_compare
(reprfunc)0, // tp_repr
//
// Type categories
//
0, // tp_as_number
0, // tp_as_sequence
0, // tp_as_mapping
//
// More methods
//
0, // tp_hash
0, // tp_call
(reprfunc)H5PartRandomSampleAttributes_str, // tp_str
0, // tp_getattro
0, // tp_setattro
0, // tp_as_buffer
Py_TPFLAGS_CHECKTYPES, // tp_flags
H5PartRandomSampleAttributes_Purpose, // tp_doc
0, // tp_traverse
0, // tp_clear
0, // tp_richcompare
0 // tp_weaklistoffset
};
//
// Helper functions for object allocation.
//
static H5PartRandomSampleAttributes *defaultAtts = 0;
static H5PartRandomSampleAttributes *currentAtts = 0;
static PyObject *
NewH5PartRandomSampleAttributes(int useCurrent)
{
H5PartRandomSampleAttributesObject *newObject;
newObject = PyObject_NEW(H5PartRandomSampleAttributesObject, &H5PartRandomSampleAttributesType);
if(newObject == NULL)
return NULL;
if(useCurrent && currentAtts != 0)
newObject->data = new H5PartRandomSampleAttributes(*currentAtts);
else if(defaultAtts != 0)
newObject->data = new H5PartRandomSampleAttributes(*defaultAtts);
else
newObject->data = new H5PartRandomSampleAttributes;
newObject->owns = true;
return (PyObject *)newObject;
}
static PyObject *
WrapH5PartRandomSampleAttributes(const H5PartRandomSampleAttributes *attr)
{
H5PartRandomSampleAttributesObject *newObject;
newObject = PyObject_NEW(H5PartRandomSampleAttributesObject, &H5PartRandomSampleAttributesType);
if(newObject == NULL)
return NULL;
newObject->data = (H5PartRandomSampleAttributes *)attr;
newObject->owns = false;
return (PyObject *)newObject;
}
///////////////////////////////////////////////////////////////////////////////
//
// Interface that is exposed to the VisIt module.
//
///////////////////////////////////////////////////////////////////////////////
PyObject *
H5PartRandomSampleAttributes_new(PyObject *self, PyObject *args)
{
int useCurrent = 0;
if (!PyArg_ParseTuple(args, "i", &useCurrent))
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
else
PyErr_Clear();
}
return (PyObject *)NewH5PartRandomSampleAttributes(useCurrent);
}
//
// Plugin method table. These methods are added to the visitmodule's methods.
//
static PyMethodDef H5PartRandomSampleAttributesMethods[] = {
{"H5PartRandomSampleAttributes", H5PartRandomSampleAttributes_new, METH_VARARGS},
{NULL, NULL} /* Sentinel */
};
static Observer *H5PartRandomSampleAttributesObserver = 0;
std::string
PyH5PartRandomSampleAttributes_GetLogString()
{
std::string s("H5PartRandomSampleAtts = H5PartRandomSampleAttributes()\n");
if(currentAtts != 0)
s += PyH5PartRandomSampleAttributes_ToString(currentAtts, "H5PartRandomSampleAtts.");
return s;
}
static void
PyH5PartRandomSampleAttributes_CallLogRoutine(Subject *subj, void *data)
{
H5PartRandomSampleAttributes *atts = (H5PartRandomSampleAttributes *)subj;
typedef void (*logCallback)(const std::string &);
logCallback cb = (logCallback)data;
if(cb != 0)
{
std::string s("H5PartRandomSampleAtts = H5PartRandomSampleAttributes()\n");
s += PyH5PartRandomSampleAttributes_ToString(currentAtts, "H5PartRandomSampleAtts.");
cb(s);
}
}
void
PyH5PartRandomSampleAttributes_StartUp(H5PartRandomSampleAttributes *subj, void *data)
{
if(subj == 0)
return;
currentAtts = subj;
PyH5PartRandomSampleAttributes_SetDefaults(subj);
//
// Create the observer that will be notified when the attributes change.
//
if(H5PartRandomSampleAttributesObserver == 0)
{
H5PartRandomSampleAttributesObserver = new ObserverToCallback(subj,
PyH5PartRandomSampleAttributes_CallLogRoutine, (void *)data);
}
}
void
PyH5PartRandomSampleAttributes_CloseDown()
{
delete defaultAtts;
defaultAtts = 0;
delete H5PartRandomSampleAttributesObserver;
H5PartRandomSampleAttributesObserver = 0;
}
PyMethodDef *
PyH5PartRandomSampleAttributes_GetMethodTable(int *nMethods)
{
*nMethods = 1;
return H5PartRandomSampleAttributesMethods;
}
bool
PyH5PartRandomSampleAttributes_Check(PyObject *obj)
{
return (obj->ob_type == &H5PartRandomSampleAttributesType);
}
H5PartRandomSampleAttributes *
PyH5PartRandomSampleAttributes_FromPyObject(PyObject *obj)
{
H5PartRandomSampleAttributesObject *obj2 = (H5PartRandomSampleAttributesObject *)obj;
return obj2->data;
}
PyObject *
PyH5PartRandomSampleAttributes_NewPyObject()
{
return NewH5PartRandomSampleAttributes(0);
}
PyObject *
PyH5PartRandomSampleAttributes_WrapPyObject(const H5PartRandomSampleAttributes *attr)
{
return WrapH5PartRandomSampleAttributes(attr);
}
void
PyH5PartRandomSampleAttributes_SetDefaults(const H5PartRandomSampleAttributes *atts)
{
if(defaultAtts)
delete defaultAtts;
defaultAtts = new H5PartRandomSampleAttributes(*atts);
}
@@ -0,0 +1,21 @@
#ifndef PY_H5PARTRANDOMSAMPLEATTRIBUTES_H
#define PY_H5PARTRANDOMSAMPLEATTRIBUTES_H
#include <Python.h>
#include <H5PartRandomSampleAttributes.h>
//
// Functions exposed to the VisIt module.
//
void PyH5PartRandomSampleAttributes_StartUp(H5PartRandomSampleAttributes *subj, void *data);
void PyH5PartRandomSampleAttributes_CloseDown();
PyMethodDef *PyH5PartRandomSampleAttributes_GetMethodTable(int *nMethods);
bool PyH5PartRandomSampleAttributes_Check(PyObject *obj);
H5PartRandomSampleAttributes *PyH5PartRandomSampleAttributes_FromPyObject(PyObject *obj);
PyObject *PyH5PartRandomSampleAttributes_NewPyObject();
PyObject *PyH5PartRandomSampleAttributes_WrapPyObject(const H5PartRandomSampleAttributes *attr);
void PyH5PartRandomSampleAttributes_SetDefaults(const H5PartRandomSampleAttributes *atts);
std::string PyH5PartRandomSampleAttributes_GetLogString();
std::string PyH5PartRandomSampleAttributes_ToString(const H5PartRandomSampleAttributes *, const char *);
#endif
@@ -0,0 +1,199 @@
#include "QvisH5PartRandomSampleWindow.h"
#include <H5PartRandomSampleAttributes.h>
#include <ViewerProxy.h>
#include <qcheckbox.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qspinbox.h>
#include <qvbox.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
#include <QvisColorTableButton.h>
#include <QvisOpacitySlider.h>
#include <QvisColorButton.h>
#include <QvisLineStyleWidget.h>
#include <QvisLineWidthWidget.h>
#include <QvisVariableButton.h>
#include <stdio.h>
#include <string>
using std::string;
// ****************************************************************************
// Method: QvisH5PartRandomSampleWindow::QvisH5PartRandomSampleWindow
//
// Purpose:
// Constructor
//
// Programmer: xml2window
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
QvisH5PartRandomSampleWindow::QvisH5PartRandomSampleWindow(const int type,
H5PartRandomSampleAttributes *subj,
const char *caption,
const char *shortName,
QvisNotepadArea *notepad)
: QvisOperatorWindow(type,subj, caption, shortName, notepad)
{
atts = subj;
}
// ****************************************************************************
// Method: QvisH5PartRandomSampleWindow::~QvisH5PartRandomSampleWindow
//
// Purpose:
// Destructor
//
// Programmer: xml2window
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
QvisH5PartRandomSampleWindow::~QvisH5PartRandomSampleWindow()
{
}
// ****************************************************************************
// Method: QvisH5PartRandomSampleWindow::CreateWindowContents
//
// Purpose:
// Creates the widgets for the window.
//
// Programmer: xml2window
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
void
QvisH5PartRandomSampleWindow::CreateWindowContents()
{
QGridLayout *mainLayout = new QGridLayout(topLayout, 1,2, 10, "mainLayout");
factorLabel = new QLabel("factor", central, "factorLabel");
mainLayout->addWidget(factorLabel,0,0);
factor = new QLineEdit(central, "factor");
connect(factor, SIGNAL(returnPressed()),
this, SLOT(factorProcessText()));
mainLayout->addWidget(factor, 0,1);
}
// ****************************************************************************
// Method: QvisH5PartRandomSampleWindow::UpdateWindow
//
// Purpose:
// Updates the widgets in the window when the subject changes.
//
// Programmer: xml2window
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
void
QvisH5PartRandomSampleWindow::UpdateWindow(bool doAll)
{
QString temp;
double r;
for(int i = 0; i < atts->NumAttributes(); ++i)
{
if(!doAll)
{
if(!atts->IsSelected(i))
{
continue;
}
}
const double *dptr;
const float *fptr;
const int *iptr;
const char *cptr;
const unsigned char *uptr;
const string *sptr;
QColor tempcolor;
switch(i)
{
case 0: //factor
temp.setNum(atts->GetFactor());
factor->setText(temp);
break;
}
}
}
// ****************************************************************************
// Method: QvisH5PartRandomSampleWindow::GetCurrentValues
//
// Purpose:
// Gets values from certain widgets and stores them in the subject.
//
// Programmer: xml2window
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
void
QvisH5PartRandomSampleWindow::GetCurrentValues(int which_widget)
{
bool okay, doAll = (which_widget == -1);
QString msg, temp;
// Do factor
if(which_widget == 0 || doAll)
{
temp = factor->displayText().simplifyWhiteSpace();
okay = !temp.isEmpty();
if(okay)
{
float val = temp.toFloat(&okay);
atts->SetFactor(val);
}
if(!okay)
{
msg.sprintf("The value of factor was invalid. "
"Resetting to the last good value of %g.",
atts->GetFactor());
Message(msg);
atts->SetFactor(atts->GetFactor());
}
}
}
//
// Qt Slot functions
//
void
QvisH5PartRandomSampleWindow::factorProcessText()
{
GetCurrentValues(0);
Apply();
}
@@ -0,0 +1,61 @@
#ifndef QVISH5PARTRANDOMSAMPLEWINDOW_H
#define QVISH5PARTRANDOMSAMPLEWINDOW_H
#include <QvisOperatorWindow.h>
#include <AttributeSubject.h>
class H5PartRandomSampleAttributes;
class QLabel;
class QCheckBox;
class QLineEdit;
class QSpinBox;
class QVBox;
class QButtonGroup;
class QvisColorTableButton;
class QvisOpacitySlider;
class QvisColorButton;
class QvisLineStyleWidget;
class QvisLineWidthWidget;
class QvisVariableButton;
// ****************************************************************************
// Class: QvisH5PartRandomSampleWindow
//
// Purpose:
// Defines QvisH5PartRandomSampleWindow class.
//
// Notes: This class was automatically generated!
// Programmer: xml2window
// Creation: Thu Mar 16 10:26:55 PDT 2006
//
// Modifications:
//
// ****************************************************************************
class QvisH5PartRandomSampleWindow : public QvisOperatorWindow
{
Q_OBJECT
public:
QvisH5PartRandomSampleWindow(const int type,
H5PartRandomSampleAttributes *subj,
const char *caption = 0,
const char *shortName = 0,
QvisNotepadArea *notepad = 0);
virtual ~QvisH5PartRandomSampleWindow();
virtual void CreateWindowContents();
protected:
void UpdateWindow(bool doAll);
virtual void GetCurrentValues(int which_widget);
private slots:
void factorProcessText();
private:
QLineEdit *factor;
QLabel *factorLabel;
H5PartRandomSampleAttributes *atts;
};
#endif
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<Plugin name="H5PartRandomSample" type="operator" label="H5PartRandomSample" version="1.0" enabled="true" mdspecificcode="false" onlyengine="false" noengine="false" iconFile="icon.xpm">
<Attribute name="H5PartRandomSampleAttributes" purpose="Randomly reduce an H5Part point mesh" persistent="true" exportAPI="" exportInclude="">
<Field name="factor" label="factor" type="float">
1.0
</Field>
</Attribute>
</Plugin>
@@ -0,0 +1,177 @@
// ************************************************************************* //
// File: avtH5PartRandomSampleFilter.C
// ************************************************************************* //
#include <avtH5PartRandomSampleFilter.h>
#include <vtkDataSet.h>
#include <vtkPolyData.h>
#include <vtkPointData.h>
#include <vtkVisItUtility.h>
#include <vtkIdTypeArray.h>
#include <vtkCell.h>
#include <vtkCellData.h>
#include <vtkCellLocator.h>
#include <vtkGenericCell.h>
// ****************************************************************************
// Method: avtH5PartRandomSampleFilter constructor
//
// Programmer: cristina -- generated by xml2avt
// Creation: Thu Mar 2 13:48:31 PST 2006
//
// ****************************************************************************
avtH5PartRandomSampleFilter::avtH5PartRandomSampleFilter()
{
idList = vtkIdList::New();
npoints = 0;
}
// ****************************************************************************
// Method: avtH5PartRandomSampleFilter destructor
//
// Programmer: cristina -- generated by xml2avt
// Creation: Thu Mar 2 13:48:31 PST 2006
//
// Modifications:
//
// ****************************************************************************
avtH5PartRandomSampleFilter::~avtH5PartRandomSampleFilter()
{
}
// ****************************************************************************
// Method: avtH5PartRandomSampleFilter::Create
//
// Programmer: cristina -- generated by xml2avt
// Creation: Thu Mar 2 13:48:31 PST 2006
//
// ****************************************************************************
avtFilter *
avtH5PartRandomSampleFilter::Create()
{
return new avtH5PartRandomSampleFilter();
}
// ****************************************************************************
// Method: avtH5PartRandomSampleFilter::SetAtts
//
// Purpose:
// Sets the state of the filter based on the attribute object.
//
// Arguments:
// a The attributes to use.
//
// Programmer: cristina -- generated by xml2avt
// Creation: Thu Mar 2 13:48:31 PST 2006
//
// ****************************************************************************
void
avtH5PartRandomSampleFilter::SetAtts(const AttributeGroup *a)
{
atts = *(const H5PartRandomSampleAttributes*)a;
}
// ****************************************************************************
// Method: avtH5PartRandomSampleFilter::Equivalent
//
// Purpose:
// Returns true if creating a new avtH5PartRandomSampleFilter with the given
// parameters would result in an equivalent avtH5PartRandomSampleFilter.
//
// Programmer: cristina -- generated by xml2avt
// Creation: Thu Mar 2 13:48:31 PST 2006
//
// ****************************************************************************
bool
avtH5PartRandomSampleFilter::Equivalent(const AttributeGroup *a)
{
return (atts == *(H5PartRandomSampleAttributes*)a);
}
// ****************************************************************************
// Method: avtH5PartRandomSampleFilter::ExecuteData
//
// Purpose:
// Sends the specified input and output through the H5PartRandomSample filter.
//
// Arguments:
// in_ds The input dataset.
// <unused> The domain number.
// <unused> The label.
//
// Returns: The output dataset.
//
// Programmer: cristina -- generated by xml2avt
// Creation: Thu Mar 2 13:48:31 PST 2006
//
// ****************************************************************************
vtkDataSet *
avtH5PartRandomSampleFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
{
float factor = atts.GetFactor();
int nspace = 3;
int update = 0;
if (factor >= 1.0) {
in_ds->Register(NULL);
return in_ds;
} else if (factor < 0){
factor = 0.0;
}
vtkIdType nPoints = in_ds->GetNumberOfPoints();
vtkPointData *inPD = in_ds->GetPointData();
vtkPolyData *out_ds = vtkPolyData::New();
vtkPoints *pts = vtkPoints::New();
pts->SetNumberOfPoints((vtkIdType) (nPoints*factor));
out_ds->SetPoints(pts);
out_ds->Allocate(nspace*((vtkIdType) (nPoints*factor)));
vtkPointData *outPD = out_ds->GetPointData();
outPD->CopyAllocate(inPD, 0, (vtkIdType) (nPoints*factor));
double sfactor = (double) (nPoints-1)/RAND_MAX;
seed=12;
srand(seed);
vtkIdType i, index;
vtkIdType newId = 0;
vtkIdType onevertex[1];
for (vtkIdType i = 0; newId < (vtkIdType)(nPoints*factor); i++) {
index = (vtkIdType) (sfactor * rand());
if (idList->IsId(index) != -1){
continue;
} else {
idList->InsertNextId(index);
}
outPD->CopyData(inPD, index, newId);
float pt[3];
in_ds->GetPoint(index, pt);
pts->SetPoint(newId, pt);
onevertex[0] = newId;
out_ds->InsertNextCell(VTK_VERTEX, 1, onevertex);
newId++;
}
idList->Reset();
idList->Delete();
pts->Delete();
return out_ds;
}
@@ -0,0 +1,54 @@
// ************************************************************************* //
// File: avtH5PartRandomSampleFilter.h
// ************************************************************************* //
#ifndef AVT_H5PartRandomSample_FILTER_H
#define AVT_H5PartRandomSample_FILTER_H
#include <avtPluginStreamer.h>
#include <H5PartRandomSampleAttributes.h>
class vtkDataSet;
class vtkIdList;
// ****************************************************************************
// Class: avtH5PartRandomSampleFilter
//
// Purpose:
// A plugin operator for H5PartRandomSample.
//
// Programmer: cristina -- generated by xml2avt
// Creation: Thu Mar 2 13:48:31 PST 2006
//
// ****************************************************************************
class avtH5PartRandomSampleFilter : public avtPluginStreamer
{
public:
avtH5PartRandomSampleFilter();
virtual ~avtH5PartRandomSampleFilter();
static avtFilter *Create();
virtual const char *GetType(void) { return "avtH5PartRandomSampleFilter"; };
virtual const char *GetDescription(void)
{ return "H5PartRandomSample"; };
virtual void SetAtts(const AttributeGroup*);
virtual bool Equivalent(const AttributeGroup*);
protected:
H5PartRandomSampleAttributes atts;
virtual vtkDataSet *ExecuteData(vtkDataSet *, int, std::string);
private:
long int npoints;
unsigned int seed;
vtkIdList *idList;
};
#endif
File diff suppressed because it is too large Load Diff