Skip to content
Snippets Groups Projects
Commit 169b4fbb authored by Owen Arnold's avatar Owen Arnold
Browse files

refs #1624 remove inc

parent 2004970d
No related merge requests found
Showing
with 0 additions and 1106 deletions
#ifndef DIMENSION_WIDGET_H
#define DIMENSION_WIDGET_H
#include <qgridlayout.h>
#include <qwidget.h>
#include <memory>
#include "boost/shared_ptr.hpp"
#include <vector>
//Foward decs
class QLabel;
class QComboBox;
class QLineEdit;
class GeometryWidget;
namespace Mantid
{
namespace Geometry
{
class IMDDimension;
}
}
class DimensionWidget: public QWidget
{
Q_OBJECT
public:
DimensionWidget(GeometryWidget* geometryWidget, const std::string& name, const int dimensionIndex,
std::vector<boost::shared_ptr<Mantid::Geometry::IMDDimension> > nonIntegratedDimensions );
~DimensionWidget();
double getMinimum() const;
double getMaximum() const;
void setMinimum(double minimum);
void setMaximum(double maximum);
boost::shared_ptr<Mantid::Geometry::IMDDimension> getDimension() const;
int getNBins() const;
int getSelectedIndex() const;
/// Populates gui controls. May be called more than once.
void populateWidget(const int dimensionIndex);
signals:
void maxSet();
void minSet();
void nBinsSet();
private:
QGridLayout* m_layout;
QLineEdit* m_nBinsBox;
QLineEdit* m_minBox;
QLineEdit* m_maxBox;
QComboBox* m_dimensionCombo;
int m_currentDimensionIndex;
std::string m_name;
GeometryWidget* m_geometryWidget;
/// Creates gui layout and controls.
void constructWidget(const int dimensionIndex);
std::vector<boost::shared_ptr<Mantid::Geometry::IMDDimension> > m_vecNonIntegratedDimensions;
private slots:
/// Handles dimension change events.
void dimensionSelectedListener();
void nBinsListener();
void maxBoxListener();
void minBoxListener();
};
#endif
#ifndef GEOMETRY_WIDGET_H
#define GEOMETRY_WIDGET_H
/** This is the GUI implementation of the geometry layout for the Rebinning operations.
* Inpects input geometry to determine possibilities for shaping the geometry via the user interface.
* Manages DimensionWidget and IntegratedDimensionWidget types.
@author Owen Arnold Tessella/ISIS
@date January 10/2011
Copyright &copy; 2008 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
#include <qgridlayout.h>
#include <qwidget.h>
#include <memory>
#include <boost/shared_ptr.hpp>
//Foward decs
class QLabel;
class QComboBox;
class IntegratedDimensionWidget;
class DimensionWidget;
namespace Mantid
{
namespace Geometry
{
class MDGeometry;
class IMDDimension;
}
}
class GeometryWidget: public QWidget
{
Q_OBJECT
public:
GeometryWidget();
void constructWidget(std::vector<boost::shared_ptr<Mantid::Geometry::IMDDimension> > nonIntegratedVector);
void childAppliedNewDimensionSelection(
const unsigned int oldDimensionIndex,
boost::shared_ptr<Mantid::Geometry::IMDDimension> newDimension,
DimensionWidget* pDimensionWidget);
void dimensionWidgetChanged();
~GeometryWidget();
/// Gets the x dimension in a serialized form
std::string getXDimensionXML() const;
/// Gets the y dimension in a serialized form
std::string getYDimensionXML() const;
/// Gets the z dimension in a serialzed form
std::string getZDimensionXML() const;
/// Gets the t dimension in a serialized form
std::string gettDimensionXML() const;
bool isSetup() const
{
return m_isConstructed;
}
/// Single signal gets raised if anything changes
signals:
void valueChanged();
private:
/// Check that constructWidget has been called.
void validateSetup() const;
DimensionWidget* m_xDimensionWidget;
DimensionWidget* m_yDimensionWidget;
DimensionWidget* m_zDimensionWidget;
DimensionWidget* m_tDimensionWidget;
bool m_isConstructed;
std::vector<boost::shared_ptr<Mantid::Geometry::IMDDimension> > m_nonIntegratedVector;
};
#endif
#ifndef INTEGRATED_DIMENSION_WIDGET_H
#define INTEGRATED_DIMENSION_WIDGET_H
#include <qgridlayout.h>
#include <qwidget.h>
class RebinningCutterAttributes;
class QLabel;
class QLineEdit;
class IntegratedDimensionWidget: public QWidget
{
Q_OBJECT
public:
IntegratedDimensionWidget(std::string dimensionName, double min, double max); //TODO, widget should have ref to Dimension
~IntegratedDimensionWidget()
{
}
double getLowerLimit() const;
double getUpperLimit() const;
private:
QLineEdit* m_LowerLimitInput;
QLineEdit* m_UpperLimitInput;
};
#endif
/*****************************************************************************
*
* Copyright (c) 2000 - 2010, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-442911
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
#ifndef PY_REBINNINGCUTTER_H
#define PY_REBINNINGCUTTER_H
#include <Python.h>
#include <RebinningCutter.h>
//
// Functions exposed to the VisIt module.
//
#define REBINNINGCUTTER_NMETH 6
void PyRebinningCutter_StartUp(RebinningCutter *subj, void *data);
void PyRebinningCutter_CloseDown();
PyMethodDef * PyRebinningCutter_GetMethodTable(int *nMethods);
bool PyRebinningCutter_Check(PyObject *obj);
RebinningCutter * PyRebinningCutter_FromPyObject(PyObject *obj);
PyObject * PyRebinningCutter_New();
PyObject * PyRebinningCutter_Wrap(const RebinningCutter *attr);
void PyRebinningCutter_SetParent(PyObject *obj, PyObject *parent);
void PyRebinningCutter_SetDefaults(const RebinningCutter *atts);
std::string PyRebinningCutter_GetLogString();
std::string PyRebinningCutter_ToString(const RebinningCutter *, const char *);
PyObject * PyRebinningCutter_getattr(PyObject *self, char *name);
int PyRebinningCutter_setattr(PyObject *self, char *name, PyObject *args);
extern PyMethodDef PyRebinningCutter_methods[REBINNINGCUTTER_NMETH];
#endif
/*****************************************************************************
*
* Copyright (c) 2000 - 2010, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-442911
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
#ifndef PY_REBINNINGCUTTERATTRIBUTES_H
#define PY_REBINNINGCUTTERATTRIBUTES_H
#include <Python.h>
#include <RebinningCutterAttributes.h>
//
// Functions exposed to the VisIt module.
//
#define REBINNINGCUTTERATTRIBUTES_NMETH 42
void PyRebinningCutterAttributes_StartUp(RebinningCutterAttributes *subj, void *data);
void PyRebinningCutterAttributes_CloseDown();
PyMethodDef * PyRebinningCutterAttributes_GetMethodTable(int *nMethods);
bool PyRebinningCutterAttributes_Check(PyObject *obj);
RebinningCutterAttributes * PyRebinningCutterAttributes_FromPyObject(PyObject *obj);
PyObject * PyRebinningCutterAttributes_New();
PyObject * PyRebinningCutterAttributes_Wrap(const RebinningCutterAttributes *attr);
void PyRebinningCutterAttributes_SetParent(PyObject *obj, PyObject *parent);
void PyRebinningCutterAttributes_SetDefaults(const RebinningCutterAttributes *atts);
std::string PyRebinningCutterAttributes_GetLogString();
std::string PyRebinningCutterAttributes_ToString(const RebinningCutterAttributes *, const char *);
PyObject * PyRebinningCutterAttributes_getattr(PyObject *self, char *name);
int PyRebinningCutterAttributes_setattr(PyObject *self, char *name, PyObject *args);
extern PyMethodDef PyRebinningCutterAttributes_methods[REBINNINGCUTTERATTRIBUTES_NMETH];
#endif
/*****************************************************************************
*
* Copyright (c) 2000 - 2010, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-442911
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
#ifndef QVISREBINNINGCUTTERWINDOW_H
#define QVISREBINNINGCUTTERWINDOW_H
#include <QvisOperatorWindow.h>
#include <AttributeSubject.h>
#include <qgridlayout.h>
#include <qwidget.h>
class RebinningCutterAttributes;
class PlotInfoAttributes;
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 QComboBox;
class GeometryWidget;
// ****************************************************************************
// Class: QvisRebinningCutterWindow
//
// Purpose:
// Defines QvisRebinningCutterWindow class.
//
// Notes: Autogenerated by xml2window.
//
// Programmer: xml2window
// Creation: omitted
//
// Modifications:
//
// ****************************************************************************
class QvisRebinningCutterWindow : public QvisOperatorWindow
{
Q_OBJECT
public:
QvisRebinningCutterWindow(const int type,
RebinningCutterAttributes *subj,
const QString &caption = QString::null,
const QString &shortName = QString::null,
QvisNotepadArea *notepad = 0);
virtual ~QvisRebinningCutterWindow();
virtual void CreateWindowContents();
protected:
void UpdateWindow(bool doAll);
virtual void GetCurrentValues(int which_widget);
private slots:
void originXProcessText();
void originYProcessText();
void originZProcessText();
void normalXProcessText();
void normalYProcessText();
void normalZProcessText();
void widthProcessText();
void heightProcessText();
void depthProcessText();
void structuredChanged(bool val);
void xDimensionXMLProcessText();
void yDimensionXMLProcessText();
void zDimensionXMLProcessText();
void tDimensionXMLProcessText();
void geometryChangedlistener();
//writeHeaderCallback unknown for stringVector (variable dimensionXML)
void upYProcessText();
void upZProcessText();
private:
/// If possible create the geometry widget from pipeline information.
void createGeometryWidget();
/// check wheter the current geometry information is consistent with that in the upper pipeline.
bool isInputConsistent(const std::string& inputGeometryXML);
/// helper method to determine wheter plot information is present. Returns Null if not present.
PlotInfoAttributes* findRebinningInfo() const;
QLineEdit *originX;
QLineEdit *originY;
QLineEdit *originZ;
QLineEdit *normalX;
QLineEdit *normalY;
QLineEdit *normalZ;
QLineEdit *width;
QLineEdit *height;
QLineEdit *depth;
QCheckBox *structured;
//writeHeaderData unknown for stringVector (variable dimensionXML)
QLineEdit *upY;
QLineEdit *upZ;
QLabel *originXLabel;
QLabel *originYLabel;
QLabel *originZLabel;
QLabel *normalXLabel;
QLabel *normalYLabel;
QLabel *normalZLabel;
QLabel *widthLabel;
QLabel *heightLabel;
QLabel *depthLabel;
QLabel *xDimensionXMLLabel;
QLabel *yDimensionXMLLabel;
QLabel *zDimensionXMLLabel;
QLabel *tDimensionXMLLabel;
QLabel *dimensionXMLLabel;
QLabel *upYLabel;
QLabel *upZLabel;
std::string m_cacheGeometryXML;
RebinningCutterAttributes *atts;
GeometryWidget* m_geomWidget;
QGridLayout* mainLayout;
};
#endif
/*****************************************************************************
*
* Copyright (c) 2000 - 2010, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-442911
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
#ifndef REBINNINGCUTTER_H
#define REBINNINGCUTTER_H
#include <AttributeSubject.h>
// ****************************************************************************
// Class: RebinningCutter
//
// Purpose:
//
//
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: omitted
//
// Modifications:
//
// ****************************************************************************
class RebinningCutter : public AttributeSubject
{
public:
// These constructors are for objects of this class
RebinningCutter();
RebinningCutter(const RebinningCutter &obj);
protected:
// These constructors are for objects derived from this class
RebinningCutter(private_tmfs_t tmfs);
RebinningCutter(const RebinningCutter &obj, private_tmfs_t tmfs);
public:
virtual ~RebinningCutter();
virtual RebinningCutter& operator = (const RebinningCutter &obj);
virtual bool operator == (const RebinningCutter &obj) const;
virtual bool operator != (const RebinningCutter &obj) const;
private:
void Init();
void Copy(const RebinningCutter &obj);
public:
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();
void SelectOrigin();
void SelectNormal();
// Property setting methods
void SetOrigin(const doubleVector &origin_);
void SetNormal(const doubleVector &normal_);
// Property getting methods
const doubleVector &GetOrigin() const;
doubleVector &GetOrigin();
const doubleVector &GetNormal() const;
doubleVector &GetNormal();
// 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;
// IDs that can be used to identify fields in case statements
enum {
ID_origin = 0,
ID_normal,
ID__LAST
};
private:
doubleVector origin;
doubleVector normal;
// Static class format string for type map.
static const char *TypeMapFormatString;
static const private_tmfs_t TmfsStruct;
};
#define REBINNINGCUTTER_TMFS "d*d*"
#endif
/*****************************************************************************
*
* Copyright (c) 2000 - 2010, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-442911
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
#ifndef REBINNINGCUTTERATTRIBUTES_H
#define REBINNINGCUTTERATTRIBUTES_H
#include <string>
#include <AttributeSubject.h>
// ****************************************************************************
// Class: RebinningCutterAttributes
//
// Purpose:
// Attributes for the Rebinning Cutter
//
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: omitted
//
// Modifications:
//
// ****************************************************************************
class RebinningCutterAttributes : public AttributeSubject
{
public:
// These constructors are for objects of this class
RebinningCutterAttributes();
RebinningCutterAttributes(const RebinningCutterAttributes &obj);
protected:
// These constructors are for objects derived from this class
RebinningCutterAttributes(private_tmfs_t tmfs);
RebinningCutterAttributes(const RebinningCutterAttributes &obj, private_tmfs_t tmfs);
public:
virtual ~RebinningCutterAttributes();
virtual RebinningCutterAttributes& operator = (const RebinningCutterAttributes &obj);
virtual bool operator == (const RebinningCutterAttributes &obj) const;
virtual bool operator != (const RebinningCutterAttributes &obj) const;
private:
void Init();
void Copy(const RebinningCutterAttributes &obj);
public:
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();
void SelectXDimensionXML();
void SelectDimensionXML();
// Property setting methods
void SetOriginX(double originX_);
void SetOriginY(double originY_);
void SetOriginZ(double originZ_);
void SetNormalX(double normalX_);
void SetNormalY(double normalY_);
void SetNormalZ(double normalZ_);
void SetWidth(double width_);
void SetHeight(double height_);
void SetDepth(double depth_);
void SetStructured(bool structured_);
void SetXDimensionXML(const std::string &xDimensionXML_);
void SetYDimensionXML(int yDimensionXML_);
void SetZDimensionXML(int zDimensionXML_);
void SetTDimensionXML(int tDimensionXML_);
void SetIsSetUp(bool isSetUp_);
void SetDimensionXML(const stringVector &dimensionXML_);
void SetUpX(double upX_);
void SetUpY(double upY_);
void SetUpZ(double upZ_);
void SetIsDirty(bool isDirty_);
// Property getting methods
double GetOriginX() const;
double GetOriginY() const;
double GetOriginZ() const;
double GetNormalX() const;
double GetNormalY() const;
double GetNormalZ() const;
double GetWidth() const;
double GetHeight() const;
double GetDepth() const;
bool GetStructured() const;
const std::string &GetXDimensionXML() const;
std::string &GetXDimensionXML();
int GetYDimensionXML() const;
int GetZDimensionXML() const;
int GetTDimensionXML() const;
bool GetIsSetUp() const;
const stringVector &GetDimensionXML() const;
stringVector &GetDimensionXML();
double GetUpX() const;
double GetUpY() const;
double GetUpZ() const;
bool GetIsDirty() const;
// 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;
// IDs that can be used to identify fields in case statements
enum {
ID_originX = 0,
ID_originY,
ID_originZ,
ID_normalX,
ID_normalY,
ID_normalZ,
ID_width,
ID_height,
ID_depth,
ID_structured,
ID_xDimensionXML,
ID_yDimensionXML,
ID_zDimensionXML,
ID_tDimensionXML,
ID_isSetUp,
ID_dimensionXML,
ID_upX,
ID_upY,
ID_upZ,
ID_isDirty,
ID__LAST
};
private:
double originX;
double originY;
double originZ;
double normalX;
double normalY;
double normalZ;
double width;
double height;
double depth;
bool structured;
std::string xDimensionXML;
int yDimensionXML;
int zDimensionXML;
int tDimensionXML;
bool isSetUp;
stringVector dimensionXML;
double upX;
double upY;
double upZ;
bool isDirty;
// Static class format string for type map.
static const char *TypeMapFormatString;
static const private_tmfs_t TmfsStruct;
};
#define REBINNINGCUTTERATTRIBUTES_TMFS "dddddddddbsiiibs*dddb"
#endif
/*****************************************************************************
*
* Copyright (c) 2000 - 2010, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-442911
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
// ************************************************************************* //
// File: RebinningCutterPluginInfo.h
// ************************************************************************* //
#ifndef REBINNINGCUTTER_PLUGIN_INFO_H
#define REBINNINGCUTTER_PLUGIN_INFO_H
#include <OperatorPluginInfo.h>
#include <operator_plugin_exports.h>
class RebinningCutterAttributes;
// ****************************************************************************
// Class: RebinningCutterPluginInfo
//
// Purpose:
// Five classes that provide all the information about an RebinningCutter operator
//
// Programmer: generated by xml2info
// Creation: omitted
//
// Modifications:
//
// ****************************************************************************
class RebinningCutterGeneralPluginInfo : public virtual GeneralOperatorPluginInfo
{
public:
virtual const char *GetName() const;
virtual const char *GetVersion() const;
virtual const char *GetID() const;
virtual bool EnabledByDefault() const;
};
class RebinningCutterCommonPluginInfo : public virtual CommonOperatorPluginInfo, public virtual RebinningCutterGeneralPluginInfo
{
public:
virtual AttributeSubject *AllocAttributes();
virtual void CopyAttributes(AttributeSubject *to, AttributeSubject *from);
};
class RebinningCutterGUIPluginInfo : public virtual GUIOperatorPluginInfo, public virtual RebinningCutterCommonPluginInfo
{
public:
virtual QString *GetMenuName() const;
virtual QvisPostableWindowObserver *CreatePluginWindow(int type,
AttributeSubject *attr, const QString &caption, const QString &shortName,
QvisNotepadArea *notepad);
virtual const char **XPMIconData() const;
};
class RebinningCutterViewerPluginInfo : public virtual ViewerOperatorPluginInfo, public virtual RebinningCutterCommonPluginInfo
{
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 QString *GetMenuName() const;
virtual const char **XPMIconData() const;
static void InitializeGlobalObjects();
private:
static RebinningCutterAttributes *defaultAtts;
static RebinningCutterAttributes *clientAtts;
};
class RebinningCutterEnginePluginInfo : public virtual EngineOperatorPluginInfo, public virtual RebinningCutterCommonPluginInfo
{
public:
virtual avtPluginFilter *AllocAvtPluginFilter();
};
class RebinningCutterScriptingPluginInfo : public virtual ScriptingOperatorPluginInfo, public virtual RebinningCutterCommonPluginInfo
{
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
/*****************************************************************************
*
* Copyright (c) 2000 - 2010, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-442911
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
// ************************************************************************* //
// File: avtRebinningCutterFilter.h
// ************************************************************************* //
#ifndef AVT_RebinningCutter_FILTER_H
#define AVT_RebinningCutter_FILTER_H
#include <vtkUnstructuredGrid.h>
#include <vtkPlane.h>
#include <avtPluginDatasetToDatasetFilter.h>
#include <avtPluginDataTreeIterator.h>
#include <RebinningCutterAttributes.h>
#include <vtkVisItClipper.h>
#include <MantidVisitPresenters/RebinningCutterPresenter.h>
#include <string.h>
// ****************************************************************************
// Class: avtRebinningCutterFilter
//
// Purpose:
// A plugin operator for RebinningCutter.
//
// Programmer: spu92482 -- generated by xml2avt
// Creation: Fri Sep 24 18:04:29 PST 2010
//
// ****************************************************************************
class vtkDataSet;
class avtRebinningCutterFilter: public avtPluginDatasetToDatasetFilter
{
public:
avtRebinningCutterFilter();
virtual ~avtRebinningCutterFilter();
static avtFilter *Create();
const virtual char *GetType(void)
{
return "avtRebinningCutterFilter";
}
const virtual char *GetDescription(void)
{
return "Rebinning Cutter";
}
virtual void SetAtts(const AttributeGroup*);
virtual bool Equivalent(const AttributeGroup*);
virtual void UpdateDataObjectInfo(void);
protected:
RebinningCutterAttributes atts;
virtual void Execute();
virtual avtContract_p ModifyContract(avtContract_p);
private:
/// Timestep value from contract.
int m_timestep;
/// Name to apply to the x axis
std::string xAxisName;
/// Name to apply to the y axis
std::string yAxisName;
/// Name to apply to the z axis
std::string zAxisName;
/// Set up execution from input dataset values.
Mantid::VATES::Dimension_sptr getDimensionX(vtkDataSet* in_ds) const;
Mantid::VATES::Dimension_sptr getDimensionY(vtkDataSet* in_ds) const;
Mantid::VATES::Dimension_sptr getDimensionZ(vtkDataSet* in_ds) const;
Mantid::VATES::Dimension_sptr getDimensiont(vtkDataSet* in_ds) const;
/// Determine if a plane has been applied.
bool anyPlaneApplied() const;
/// Construct a plane, which specifies rotations if the correct information is available.
boost::shared_ptr<Mantid::API::ImplicitFunction> constructPlane() const;
/// Construct a plane, which specifies rotations if the correct information is available.
boost::shared_ptr<Mantid::API::ImplicitFunction> constructBox(
Mantid::VATES::Dimension_sptr spDimX,
Mantid::VATES::Dimension_sptr spDimY,
Mantid::VATES::Dimension_sptr spDimZ) const;
/// Helper method. Selects the dataset factory to use.
boost::shared_ptr<Mantid::VATES::vtkDataSetFactory> createDataSetFactory(Mantid::MDDataObjects::MDWorkspace_sptr spRebinnedWs) const;
/// Create a hash based on the attributes.
std::string createHash() const;
/// Optimisation method. Used to determien what strategy to use to create the dataset.
Mantid::VATES::RebinningIterationAction decideIterationAction();
/// Executor peforms the logic associated with running rebinning operations.
Mantid::VATES::RebinningCutterPresenter m_presenter;
};
// Non member helper deletion method for working with VisITs ref_void_ptr types.
void deleteTimeMarker(void* cachedMarkerVoid);
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment