Commit e1c45868 authored by sisneros's avatar sisneros

Adding ModelFit operator (multivariate analysis).

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@17056 18c085ea-50e0-402c-830e-de6fd14e8384
parent 71eca1c9
......@@ -92,6 +92,7 @@ Isovolume
Lineout
LineSampler
Merge
ModelFit
MultiresControl
OnionPeel
PDF
......
# DO NOT EDIT THIS FILE! THIS FILE IS AUTOMATICALLY GENERATED BY xml2cmake
PROJECT(ModelFit)
INCLUDE(${VISIT_SOURCE_DIR}/CMake/PluginMacros.cmake)
SET(COMMON_SOURCES
ModelFitPluginInfo.C
ModelFitCommonPluginInfo.C
ModelFitAtts.C
)
SET(LIBI_SOURCES
ModelFitPluginInfo.C
)
SET(LIBG_SOURCES
ModelFitGUIPluginInfo.C
QvisModelFitWindow.C
${COMMON_SOURCES}
)
SET(LIBG_MOC_SOURCES
QvisModelFitWindow.h
)
QT_WRAP_CPP(GModelFitOperator LIBG_SOURCES ${LIBG_MOC_SOURCES})
SET(LIBV_SOURCES
ModelFitViewerPluginInfo.C
${COMMON_SOURCES}
)
SET(LIBE_SOURCES
ModelFitEnginePluginInfo.C
avtModelFitFilter.C
${COMMON_SOURCES}
)
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
${VISIT_COMMON_INCLUDES}
${VISIT_INCLUDE_DIR}/avt/DBAtts/MetaData
${VISIT_INCLUDE_DIR}/avt/DBAtts/SIL
${VISIT_INCLUDE_DIR}/avt/Database/Database
${VISIT_INCLUDE_DIR}/avt/Expressions/Abstract
${VISIT_INCLUDE_DIR}/avt/Expressions/CMFE
${VISIT_INCLUDE_DIR}/avt/Expressions/Conditional
${VISIT_INCLUDE_DIR}/avt/Expressions/Derivations
${VISIT_INCLUDE_DIR}/avt/Expressions/General
${VISIT_INCLUDE_DIR}/avt/Expressions/ImageProcessing
${VISIT_INCLUDE_DIR}/avt/Expressions/Management
${VISIT_INCLUDE_DIR}/avt/Expressions/Math
${VISIT_INCLUDE_DIR}/avt/Expressions/MeshQuality
${VISIT_INCLUDE_DIR}/avt/Expressions/TimeIterators
${VISIT_INCLUDE_DIR}/avt/FileWriter
${VISIT_INCLUDE_DIR}/avt/Filters
${VISIT_INCLUDE_DIR}/avt/IVP
${VISIT_INCLUDE_DIR}/avt/Math
${VISIT_INCLUDE_DIR}/avt/Pipeline/AbstractFilters
${VISIT_INCLUDE_DIR}/avt/Pipeline/Data
${VISIT_INCLUDE_DIR}/avt/Pipeline/Pipeline
${VISIT_INCLUDE_DIR}/avt/Pipeline/Sinks
${VISIT_INCLUDE_DIR}/avt/Pipeline/Sources
${VISIT_INCLUDE_DIR}/avt/Plotter
${VISIT_INCLUDE_DIR}/avt/QtVisWindow
${VISIT_INCLUDE_DIR}/avt/View
${VISIT_INCLUDE_DIR}/avt/VisWindow/Colleagues
${VISIT_INCLUDE_DIR}/avt/VisWindow/Interactors
${VISIT_INCLUDE_DIR}/avt/VisWindow/Proxies
${VISIT_INCLUDE_DIR}/avt/VisWindow/Tools
${VISIT_INCLUDE_DIR}/avt/VisWindow/VisWindow
${VISIT_INCLUDE_DIR}/gui
${VISIT_INCLUDE_DIR}/mdserver/proxy
${VISIT_INCLUDE_DIR}/mdserver/rpc
${VISIT_INCLUDE_DIR}/viewer/main
${VISIT_INCLUDE_DIR}/viewer/proxy
${VISIT_INCLUDE_DIR}/viewer/rpc
${VISIT_INCLUDE_DIR}/winutil
${VISIT_INCLUDE_DIR}/visit_vtk/full
${VISIT_INCLUDE_DIR}/visit_vtk/lightweight
${QT_INCLUDE_DIR}
${QT_QTCORE_INCLUDE_DIR}
${QT_QTGUI_INCLUDE_DIR}
${VTK_INCLUDE_DIRS}
${PYTHON_INCLUDE_PATH}
${VISIT_INCLUDE_DIR}/visitpy/visitpy
)
LINK_DIRECTORIES(${VISIT_LIBRARY_DIR} ${QT_LIBRARY_DIR} ${GLEW_LIBRARY_DIR} ${VTK_LIBRARY_DIRS} )
ADD_LIBRARY(IModelFitOperator ${LIBI_SOURCES})
TARGET_LINK_LIBRARIES(IModelFitOperator visitcommon)
SET(INSTALLTARGETS IModelFitOperator)
IF(NOT VISIT_SERVER_COMPONENTS_ONLY AND NOT VISIT_ENGINE_ONLY AND NOT VISIT_DBIO_ONLY)
ADD_LIBRARY(GModelFitOperator ${LIBG_SOURCES})
TARGET_LINK_LIBRARIES(GModelFitOperator visitcommon gui )
ADD_LIBRARY(VModelFitOperator ${LIBV_SOURCES})
TARGET_LINK_LIBRARIES(VModelFitOperator visitcommon viewer )
SET(INSTALLTARGETS ${INSTALLTARGETS} GModelFitOperator VModelFitOperator)
IF(VISIT_PYTHON_SCRIPTING)
SET(LIBS_SOURCES
ModelFitScriptingPluginInfo.C
PyModelFitAtts.C
${COMMON_SOURCES}
)
ADD_LIBRARY(SModelFitOperator ${LIBS_SOURCES})
TARGET_LINK_LIBRARIES(SModelFitOperator visitcommon visitpy ${PYTHON_LIBRARY})
SET(INSTALLTARGETS ${INSTALLTARGETS} SModelFitOperator)
ENDIF(VISIT_PYTHON_SCRIPTING)
IF(VISIT_JAVA)
ADD_CUSTOM_TARGET(JavaModelFit ALL ${CMAKE_Java_COMPILER} ${CMAKE_Java_FLAGS} -d ${VISIT_BINARY_DIR}/java -classpath ${VISIT_BINARY_DIR}/java ModelFitAtts.java)
ADD_DEPENDENCIES(JavaModelFit JavaClient)
ENDIF(VISIT_JAVA)
ENDIF(NOT VISIT_SERVER_COMPONENTS_ONLY AND NOT VISIT_ENGINE_ONLY AND NOT VISIT_DBIO_ONLY)
ADD_LIBRARY(EModelFitOperator_ser ${LIBE_SOURCES})
TARGET_LINK_LIBRARIES(EModelFitOperator_ser visitcommon avtexpressions_ser avtfilters_ser avtpipeline_ser )
SET(INSTALLTARGETS ${INSTALLTARGETS} EModelFitOperator_ser)
IF(VISIT_PARALLEL)
ADD_PARALLEL_LIBRARY(EModelFitOperator_par ${LIBE_SOURCES})
TARGET_LINK_LIBRARIES(EModelFitOperator_par visitcommon avtexpressions_par avtfilters_par avtpipeline_par )
SET(INSTALLTARGETS ${INSTALLTARGETS} EModelFitOperator_par)
ENDIF(VISIT_PARALLEL)
VISIT_INSTALL_OPERATOR_PLUGINS(${INSTALLTARGETS})
VISIT_PLUGIN_TARGET_RTOD(operators ${INSTALLTARGETS})
VISIT_PLUGIN_TARGET_FOLDER(operators ModelFit ${INSTALLTARGETS})
<?xml version="1.0"?>
<Plugin name="ModelFit" type="operator" label="ModelFit" version="1.0" enabled="true" mdspecificcode="false" engspecificcode="false" onlyengine="false" noengine="false" category="Analysis">
<Attribute name="ModelFitAtts" purpose="This file contains attributes for the ModelFit operator." persistent="false" keyframe="true" exportAPI="" exportInclude="">
<Enum name="Spaces">
VARIABLE
NORMAL
LOG
PROBABILITY
</Enum>
<Enum name="Stats">
AVERAGE
MIN
MAX
NONE
</Enum>
<Enum name="Distances">
EUCLIDEAN
MANHATTAN
MAXIMUM
</Enum>
<Field name="Vars" label="Vars" type="stringVector">
</Field>
<Field name="numVars" label="numVars" type="intVector">
</Field>
<Field name="Tuples" label="Tuples" type="doubleVector">
</Field>
<Field name="StatTuples" label="StatTuples" type="ucharVector">
</Field>
<Field name="numTups" label="numTups" type="intVector">
</Field>
<Field name="thold" label="thold" type="doubleVector">
</Field>
<Field name="selectionType" label="selectionType" type="intVector">
</Field>
<Field name="distanceType" label="distanceType" type="intVector">
</Field>
<Field name="inputSpace" label="inputSpace" type="intVector">
</Field>
<Field name="modelNames" label="modelNames" type="stringVector">
</Field>
<Field name="modelNums" label="modelNums" type="intVector">
</Field>
</Attribute>
</Plugin>
This diff is collapsed.
/*****************************************************************************
*
* Copyright (c) 2000 - 2011, 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 MODELFITATTS_H
#define MODELFITATTS_H
#include <string>
#include <AttributeSubject.h>
// ****************************************************************************
// Class: ModelFitAtts
//
// Purpose:
// This file contains attributes for the ModelFit operator.
//
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: omitted
//
// Modifications:
//
// ****************************************************************************
class ModelFitAtts : public AttributeSubject
{
public:
enum Spaces
{
VARIABLE,
NORMAL,
LOG,
PROBABILITY
};
enum Stats
{
AVERAGE,
MIN,
MAX,
NONE
};
enum Distances
{
EUCLIDEAN,
MANHATTAN,
MAXIMUM
};
// These constructors are for objects of this class
ModelFitAtts();
ModelFitAtts(const ModelFitAtts &obj);
protected:
// These constructors are for objects derived from this class
ModelFitAtts(private_tmfs_t tmfs);
ModelFitAtts(const ModelFitAtts &obj, private_tmfs_t tmfs);
public:
virtual ~ModelFitAtts();
virtual ModelFitAtts& operator = (const ModelFitAtts &obj);
virtual bool operator == (const ModelFitAtts &obj) const;
virtual bool operator != (const ModelFitAtts &obj) const;
private:
void Init();
void Copy(const ModelFitAtts &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 SelectVars();
void SelectNumVars();
void SelectTuples();
void SelectStatTuples();
void SelectNumTups();
void SelectThold();
void SelectSelectionType();
void SelectDistanceType();
void SelectInputSpace();
void SelectModelNames();
void SelectModelNums();
// Property setting methods
void SetVars(const stringVector &Vars_);
void SetNumVars(const intVector &numVars_);
void SetTuples(const doubleVector &Tuples_);
void SetStatTuples(const unsignedCharVector &StatTuples_);
void SetNumTups(const intVector &numTups_);
void SetThold(const doubleVector &thold_);
void SetSelectionType(const intVector &selectionType_);
void SetDistanceType(const intVector &distanceType_);
void SetInputSpace(const intVector &inputSpace_);
void SetModelNames(const stringVector &modelNames_);
void SetModelNums(const intVector &modelNums_);
// Property getting methods
const stringVector &GetVars() const;
stringVector &GetVars();
const intVector &GetNumVars() const;
intVector &GetNumVars();
const doubleVector &GetTuples() const;
doubleVector &GetTuples();
const unsignedCharVector &GetStatTuples() const;
unsignedCharVector &GetStatTuples();
const intVector &GetNumTups() const;
intVector &GetNumTups();
const doubleVector &GetThold() const;
doubleVector &GetThold();
const intVector &GetSelectionType() const;
intVector &GetSelectionType();
const intVector &GetDistanceType() const;
intVector &GetDistanceType();
const intVector &GetInputSpace() const;
intVector &GetInputSpace();
const stringVector &GetModelNames() const;
stringVector &GetModelNames();
const intVector &GetModelNums() const;
intVector &GetModelNums();
// Enum conversion functions
static std::string Spaces_ToString(Spaces);
static bool Spaces_FromString(const std::string &, Spaces &);
protected:
static std::string Spaces_ToString(int);
public:
static std::string Stats_ToString(Stats);
static bool Stats_FromString(const std::string &, Stats &);
protected:
static std::string Stats_ToString(int);
public:
static std::string Distances_ToString(Distances);
static bool Distances_FromString(const std::string &, Distances &);
protected:
static std::string Distances_ToString(int);
public:
// Keyframing methods
virtual std::string GetFieldName(int index) const;
virtual AttributeGroup::FieldType GetFieldType(int index) const;
virtual std::string GetFieldTypeName(int index) const;
virtual bool FieldsEqual(int index, const AttributeGroup *rhs) const;
// IDs that can be used to identify fields in case statements
enum {
ID_Vars = 0,
ID_numVars,
ID_Tuples,
ID_StatTuples,
ID_numTups,
ID_thold,
ID_selectionType,
ID_distanceType,
ID_inputSpace,
ID_modelNames,
ID_modelNums,
ID__LAST
};
private:
stringVector Vars;
intVector numVars;
doubleVector Tuples;
unsignedCharVector StatTuples;
intVector numTups;
doubleVector thold;
intVector selectionType;
intVector distanceType;
intVector inputSpace;
stringVector modelNames;
intVector modelNums;
// Static class format string for type map.
static const char *TypeMapFormatString;
static const private_tmfs_t TmfsStruct;
};
#define MODELFITATTS_TMFS "s*i*d*u*i*d*i*i*i*s*i*"
#endif
// ***************************************************************************
//
// Copyright (c) 2000 - 2011, 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.
//
// ***************************************************************************
package llnl.visit.operators;
import llnl.visit.AttributeSubject;
import llnl.visit.CommunicationBuffer;
import llnl.visit.Plugin;
import java.util.Vector;
import java.lang.Integer;
import java.lang.Double;
import java.lang.Byte;
// ****************************************************************************
// Class: ModelFitAtts
//
// Purpose:
// This file contains attributes for the ModelFit operator.
//
// Notes: Autogenerated by xml2java.
//
// Programmer: xml2java
// Creation: omitted
//
// Modifications:
//
// ****************************************************************************
public class ModelFitAtts extends AttributeSubject implements Plugin
{
private static int ModelFitAtts_numAdditionalAtts = 11;
// Enum values
public final static int SPACES_VARIABLE = 0;
public final static int SPACES_NORMAL = 1;
public final static int SPACES_LOG = 2;
public final static int SPACES_PROBABILITY = 3;
public final static int STATS_AVERAGE = 0;
public final static int STATS_MIN = 1;
public final static int STATS_MAX = 2;
public final static int STATS_NONE = 3;
public final static int DISTANCES_EUCLIDEAN = 0;
public final static int DISTANCES_MANHATTAN = 1;
public final static int DISTANCES_MAXIMUM = 2;
public ModelFitAtts()
{
super(ModelFitAtts_numAdditionalAtts);
Vars = new Vector();
numVars = new Vector();
Tuples = new Vector();
StatTuples = new Vector();
numTups = new Vector();
thold = new Vector();
selectionType = new Vector();
distanceType = new Vector();
inputSpace = new Vector();
modelNames = new Vector();
modelNums = new Vector();
}
public ModelFitAtts(int nMoreFields)
{
super(ModelFitAtts_numAdditionalAtts + nMoreFields);
Vars = new Vector();
numVars = new Vector();
Tuples = new Vector();
StatTuples = new Vector();
numTups = new Vector();
thold = new Vector();
selectionType = new Vector();
distanceType = new Vector();
inputSpace = new Vector();
modelNames = new Vector();
modelNums = new Vector();
}
public ModelFitAtts(ModelFitAtts obj)
{
super(ModelFitAtts_numAdditionalAtts);
int i;
Vars = new Vector(obj.Vars.size());
for(i = 0; i < obj.Vars.size(); ++i)
Vars.addElement(new String((String)obj.Vars.elementAt(i)));
numVars = new Vector();
for(i = 0; i < obj.numVars.size(); ++i)
{
Integer iv = (Integer)obj.numVars.elementAt(i);
numVars.addElement(new Integer(iv.intValue()));
}
Tuples = new Vector(obj.Tuples.size());
for(i = 0; i < obj.Tuples.size(); ++i)
{
Double dv = (Double)obj.Tuples.elementAt(i);
Tuples.addElement(new Double(dv.doubleValue()));
}
StatTuples = new Vector(obj.StatTuples.size());
for(i = 0; i < obj.StatTuples.size(); ++i)
{
Byte bv = (Byte)obj.StatTuples.elementAt(i);
StatTuples.addElement(new Byte(bv.byteValue()));
}
numTups = new Vector();
for(i = 0; i < obj.numTups.size(); ++i)
{
Integer iv = (Integer)obj.numTups.elementAt(i);
numTups.addElement(new Integer(iv.intValue()));
}
thold = new Vector(obj.thold.size());
for(i = 0; i < obj.thold.size(); ++i)
{
Double dv = (Double)obj.thold.elementAt(i);
thold.addElement(new Double(dv.doubleValue()));
}
selectionType = new Vector();
for(i = 0; i < obj.selectionType.size(); ++i)
{
Integer iv = (Integer)obj.selectionType.elementAt(i);
selectionType.addElement(new Integer(iv.intValue()));
}
distanceType = new Vector();
for(i = 0; i < obj.distanceType.size(); ++i)
{
Integer iv = (Integer)obj.distanceType.elementAt(i);
distanceType.addElement(new Integer(iv.intValue()));
}
inputSpace = new Vector();
for(i = 0; i < obj.inputSpace.size(); ++i)
{
Integer iv = (Integer)obj.inputSpace.elementAt(i);
inputSpace.addElement(new Integer(iv.intValue()));
}
modelNames = new Vector(obj.modelNames.size());
for(i = 0; i < obj.modelNames.size(); ++i)
modelNames.addElement(new String((String)obj.modelNames.elementAt(i)));
modelNums = new Vector();
for(i = 0; i < obj.modelNums.size(); ++i)
{
Integer iv = (Integer)obj.modelNums.elementAt(i);
modelNums.addElement(new Integer(iv.intValue()));
}
SelectAll();
}
public int Offset()
{
return super.Offset() + super.GetNumAdditionalAttributes();
}
public int GetNumAdditionalAttributes()
{
return ModelFitAtts_numAdditionalAtts;
}
public boolean equals(ModelFitAtts obj)
{
int i;
// Compare the elements in the Vars vector.
boolean Vars_equal = (obj.Vars.size() == Vars.size());
for(i = 0; (i < Vars.size()) && Vars_equal; ++i)
{
// Make references to String from Object.
String Vars1 = (String)Vars.elementAt(i);
String Vars2 = (String)obj.Vars.elementAt(i);
Vars_equal = Vars1.equals(Vars2);
}
// Compare the elements in the numVars vector.
boolean numVars_equal = (obj.numVars.size() == numVars.size());
for(i = 0; (i < numVars.size()) && numVars_equal; ++i)
{
// Make references to Integer from Object.
Integer numVars1 = (Integer)numVars.elementAt(i);
Integer numVars2 = (Integer)obj.numVars.elementAt(i);
numVars_equal = numVars1.equals(numVars2);
}
// Compare the elements in the Tuples vector.
boolean Tuples_equal = (obj.Tuples.size() == Tuples.size());