Commit ec5dadf6 authored by pugmire's avatar pugmire

Additional options for seeding streamlines.




git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@11624 18c085ea-50e0-402c-830e-de6fd14e8384
parent f4eb27ed
This diff is collapsed.
......@@ -204,6 +204,9 @@ class vtkAppendPolyData;
// Hank Childs, Tue Jun 8 09:30:45 CDT 2010
// Add method GetCommunicationPattern.
//
// Dave Pugmire, Thu Jun 10 10:44:02 EDT 2010
// New seed sources.
//
// ****************************************************************************
class AVTFILTERS_API avtStreamlineFilter : virtual public avtPICSFilter
......@@ -223,17 +226,25 @@ class AVTFILTERS_API avtStreamlineFilter : virtual public avtPICSFilter
const avtVector &p_start, int ID);
// Methods to set the filter's attributes.
void SetSourceType(int sourceType);
void SetIntersectionObject(vtkObject *obj);
void SetPointSource(double pt[3]);
void SetLineSource(double pt[3], double pt2[3]);
void SetPlaneSource(double O[3], double N[3],
double U[3], double R);
void SetSphereSource(double O[3], double R);
void SetPointSource(const double *p);
void SetLineSource(const double *p0, const double *p1,
int den, bool rand, int seed, int numPts);
void SetPlaneSource(double O[3], double N[3], double U[3],
int den1, int den2, double dist1, double dist2,
bool fill, bool rand, int seed, int numPts);
void SetCircleSource(double O[3], double N[3], double U[3], double r,
int den1, int den2,
bool fill, bool rand, int seed, int numPts);
void SetSphereSource(double O[3], double R,
int den1, int den2, int den3,
bool fill, bool rand, int seed, int numPts);
void SetBoxSource(double E[6], bool wholeBox,
int den1, int den2, int den3,
bool fill, bool rand, int seed, int numPts);
void SetPointListSource(const std::vector<double> &);
void SetBoxSource(double E[6]);
void SetUseWholeBox(bool b) { useWholeBox = b; };
void SetDisplayMethod(int d);
void SetPointDensity(int den);
......@@ -252,13 +263,18 @@ class AVTFILTERS_API avtStreamlineFilter : virtual public avtPICSFilter
std::string coloringVariable, opacityVariable;
// Various starting locations for streamlines.
std::vector<avtVector> pointList;
avtVector points[2];
avtVector vectors[2];
std::vector<double> listOfPoints;
int numSamplePoints;
int sampleDensity[3];
double sampleDistance[3];
bool randomSamples;
int randomSeed;
bool fill, useBBox;
std::string SeedInfoString() const;
double pointSource[3];
double lineStart[3], lineEnd[3];
double planeOrigin[3], planeNormal[3], planeUpAxis[3], planeRadius;
double sphereOrigin[3], sphereRadius;
double boxExtents[6];
bool useWholeBox;
vtkObject *intersectObj;
......
......@@ -84,6 +84,9 @@
// Dave Pugmire, Mon Feb 15 14:05:19 EST 2010
// Add perpendiculars method and unary - operator.
//
// Dave Pugmire, Thu Jun 10 10:44:02 EDT 2010
// Add set() methods.
//
// ****************************************************************************
class MATH_API avtVector
{
......@@ -128,6 +131,10 @@ class MATH_API avtVector
// element access
double& operator[](const size_t &i);
const double& operator[](const size_t &i) const;
void set(const double *v);
void set(const float *v);
void set(double, double, double);
void set(float, float, float);
// 2-norm
double norm() const;
......@@ -401,5 +408,33 @@ inline avtVector lerp(const double &t, const avtVector &v0, const avtVector &v1)
return result;
}
inline void avtVector::set(const double *v)
{
x=v[0];
y=v[1];
z=v[2];
}
inline void avtVector::set(const float *v)
{
x=v[0];
y=v[1];
z=v[2];
}
inline void avtVector::set(double v0, double v1, double v2)
{
x = v0;
y = v1;
z = v2;
}
inline void avtVector::set(float v0, float v1, float v2)
{
x = v0;
y = v1;
z = v2;
}
#endif
......@@ -344,6 +344,9 @@ avtPoincarePlot::EnhanceSpecification(avtContract_p in_contract)
// Hank Childs, Sun Jun 6 11:53:33 CDT 2010
// Change method name from streamline direction to integration direction.
//
// Dave Pugmire, Thu Jun 10 10:44:02 EDT 2010
// New seed sources.
//
// ****************************************************************************
void
......@@ -378,29 +381,27 @@ avtPoincarePlot::SetAtts(const AttributeGroup *a)
switch (atts.GetSourceType())
{
case PoincareAttributes::SpecifiedPoint:
poincareFilter->SetSourceType(STREAMLINE_SOURCE_POINT);
poincareFilter->SetPointSource(atts.GetPointSource());
break;
case PoincareAttributes::SpecifiedLine:
if( atts.GetPointDensity() > 1 )
{
poincareFilter->SetSourceType(STREAMLINE_SOURCE_LINE);
poincareFilter->SetLineSource(atts.GetLineStart(), atts.GetLineEnd());
poincareFilter->SetPointDensity(atts.GetPointDensity()-1);
poincareFilter->SetLineSource(atts.GetLineStart(), atts.GetLineEnd(),
atts.GetPointDensity()-1,
false, 0, 0);
}
else
{
double pt[3];
pt[0] = (atts.GetLineStart()[0] + atts.GetLineEnd()[0]) / 2;
pt[1] = (atts.GetLineStart()[1] + atts.GetLineEnd()[1]) / 2;
pt[2] = (atts.GetLineStart()[2] + atts.GetLineEnd()[2]) / 2;
double pt[3];
poincareFilter->SetSourceType(STREAMLINE_SOURCE_POINT);
poincareFilter->SetPointSource(pt);
pt[0] = (atts.GetLineStart()[0] + atts.GetLineEnd()[0]) / 2;
pt[1] = (atts.GetLineStart()[1] + atts.GetLineEnd()[1]) / 2;
pt[2] = (atts.GetLineStart()[2] + atts.GetLineEnd()[2]) / 2;
poincareFilter->SetPointSource(pt);
}
break;
}
......
This diff is collapsed.
......@@ -44,7 +44,7 @@
//
// Functions exposed to the VisIt module.
//
#define STREAMLINEATTRIBUTES_NMETH 120
#define STREAMLINEATTRIBUTES_NMETH 136
void PyStreamlineAttributes_StartUp(StreamlineAttributes *subj, void *data);
void PyStreamlineAttributes_CloseDown();
PyMethodDef * PyStreamlineAttributes_GetMethodTable(int *nMethods);
......
This diff is collapsed.
......@@ -43,6 +43,9 @@
// Forward declarations
class QLabel;
class QGroupBox;
class QListWidget;
class QListWidgetItem;
class QCheckBox;
class QComboBox;
class QLineEdit;
......@@ -52,6 +55,7 @@ class QvisColorButton;
class QvisLineWidthWidget;
class QvisVariableButton;
class QvisOpacitySlider;
class QPushButton;
class StreamlineAttributes;
// ****************************************************************************
......@@ -115,6 +119,9 @@ class StreamlineAttributes;
// Allen Sanderson, Sun Mar 7 12:49:56 PST 2010
// Change layout of window for 2.0 interface changes.
//
// Dave Pugmire, Thu Jun 10 10:44:02 EDT 2010
// New seed sources.
//
// ****************************************************************************
class QvisStreamlinePlotWindow : public QvisPostableWindowObserver
......@@ -142,6 +149,7 @@ class QvisStreamlinePlotWindow : public QvisPostableWindowObserver
void GetCurrentValues(int which_widget);
void Apply(bool ignore = false);
void UpdateSourceAttributes();
void TurnOffSourceAttributes();
void UpdateAlgorithmAttributes();
void UpdateIntegrationAttributes();
void UpdateTerminationType();
......@@ -162,10 +170,19 @@ class QvisStreamlinePlotWindow : public QvisPostableWindowObserver
void planeOriginProcessText();
void planeNormalProcessText();
void planeUpAxisProcessText();
void planeRadiusProcessText();
void radiusProcessText();
void sphereOriginProcessText();
void sphereRadiusProcessText();
void pointDensityChanged(int val);
void sampleDensity0Changed(int val);
void sampleDensity1Changed(int val);
void sampleDensity2Changed(int val);
void sampleDistance0ProcessText();
void sampleDistance1ProcessText();
void sampleDistance2ProcessText();
void randomSamplesChanged(bool);
void randomSeedChanged(int);
void numberOfRandomSamplesChanged(int);
void fillInteriorChanged(bool);
void maxSLCountChanged(int val);
void maxDomainCacheChanged(int val);
void workGroupSizeChanged(int val);
......@@ -206,6 +223,12 @@ class QvisStreamlinePlotWindow : public QvisPostableWindowObserver
void tubeDisplayDensityChanged(int);
void seedDisplayQualityChanged(int);
void headDisplayTypeChanged(int);
void pointListClicked(QListWidgetItem*);
void pointListDoubleClicked(QListWidgetItem*);
void addPoint();
void deletePoint();
void readPoints();
void textChanged(const QString &currentText);
private:
int plotType;
......@@ -224,26 +247,34 @@ class QvisStreamlinePlotWindow : public QvisPostableWindowObserver
QLabel *lineStartLabel;
QLineEdit *lineEnd;
QLabel *lineEndLabel;
QLineEdit *pointList;
QLabel *pointListLabel;
QLabel *pointListInfo;
QListWidget *pointList;
QPushButton *pointListDelPoint, *pointListAddPoint, *pointListReadPoints;
QLineEdit *planeOrigin;
QLabel *planeOriginLabel;
QLineEdit *planeNormal;
QLabel *planeNormalLabel;
QLineEdit *planeUpAxis;
QLabel *planeUpAxisLabel;
QLineEdit *planeRadius;
QLabel *planeRadiusLabel;
QLineEdit *radius;
QLabel *radiusLabel;
QLineEdit *sphereOrigin;
QLabel *sphereOriginLabel;
QLineEdit *sphereRadius;
QLabel *sphereRadiusLabel;
QCheckBox *useWholeBox;
QLineEdit *boxExtents[3];
QLabel *boxExtentsLabel[3];
QLabel *pointDensityLabel;
QSpinBox *pointDensity;
QLabel *sampleDensityLabel[3], *sampleDistanceLabel[3];
QSpinBox *sampleDensity[3];
QLineEdit *sampleDistance[3];
QGroupBox *samplingGroup;
QCheckBox *randomSamples;
QSpinBox *numberOfRandomSamples;
QLabel *numberOfRandomSamplesLabel;
QSpinBox *randomSeed;
QLabel *randomSeedLabel;
QCheckBox *fillInterior;
QComboBox *displayMethod;
QCheckBox *showSeeds, *showHeads;
QLabel *seedRadiusLabel, *headRadiusLabel, *headHeightLabel;
......@@ -251,7 +282,7 @@ class QvisStreamlinePlotWindow : public QvisPostableWindowObserver
QLabel *headDisplayTypeLabel;
QLineEdit *seedRadius, *headRadius, *headHeight;
QLineEdit *tubeRadius, *ribbonWidth;
QLabel *radiusLabel;
QLabel *geomRadiusLabel;
QvisLineWidthWidget *lineWidth;
QLabel *lineWidthLabel;
QLabel *lineWidthDummy;
......
This diff is collapsed.
......@@ -123,7 +123,7 @@
1.000000
0.000000
</Field>
<Field name="planeRadius" label="Plane radius" type="double" enabler="sourceType:SpecifiedPlane">
<Field name="radius" label="Radius" type="double">
1.000000
</Field>
<Field name="sphereOrigin" label="Sphere origin" type="doubleArray" length="3" enabler="sourceType:SpecifiedSphere">
......@@ -131,9 +131,6 @@
0.000000
0.000000
</Field>
<Field name="sphereRadius" label="Sphere radius" type="double" enabler="sourceType:SpecifiedSphere">
1.000000
</Field>
<Field name="boxExtents" label="Box extents" type="doubleArray" length="6" enabler="sourceType:SpecifiedBox">
0.000000
1.000000
......@@ -156,8 +153,14 @@
1.000000
0.000000
</Field>
<Field name="pointDensity" label="Point density" type="int" enabler="sourceType:SpecifiedLine,SpecifiedPlane,SpecifiedSphere,SpecifiedBox">
2
<Field name="sampleDensity0" label="sampleDensity0" type="int">
1
</Field>
<Field name="sampleDensity1" label="sampleDensity1" type="int">
1
</Field>
<Field name="sampleDensity2" label="sampleDensity2" type="int">
1
</Field>
<Field name="displayMethod" label="Display method" type="enum" subtype="DisplayMethod">
Lines
......@@ -289,6 +292,27 @@
<Field name="geomDisplayQuality" label="geomDisplayQuality" type="enum" subtype="DisplayQuality">
Medium
</Field>
<Field name="sampleDistance0" label="sampleDistance0" type="double">
1.000000
</Field>
<Field name="sampleDistance1" label="sampleDistance1" type="double">
1.000000
</Field>
<Field name="sampleDistance2" label="sampleDistance2" type="double">
1.000000
</Field>
<Field name="fillInterior" label="fillInterior" type="bool">
true
</Field>
<Field name="randomSamples" label="randomSamples" type="bool">
false
</Field>
<Field name="randomSeed" label="randomSeed" type="int">
0
</Field>
<Field name="numberOfRandomSamples" label="numberOfRandomSamples" type="int">
1
</Field>
<Function name="CopyAttributes" user="false" member="true">
</Function>
<Function name="CreateCompatible" user="false" member="true">
......
This diff is collapsed.
......@@ -180,13 +180,14 @@ public:
void SetPlaneOrigin(const double *planeOrigin_);
void SetPlaneNormal(const double *planeNormal_);
void SetPlaneUpAxis(const double *planeUpAxis_);
void SetPlaneRadius(double planeRadius_);
void SetRadius(double radius_);
void SetSphereOrigin(const double *sphereOrigin_);
void SetSphereRadius(double sphereRadius_);
void SetBoxExtents(const double *boxExtents_);
void SetUseWholeBox(bool useWholeBox_);
void SetPointList(const doubleVector &pointList_);
void SetPointDensity(int pointDensity_);
void SetSampleDensity0(int sampleDensity0_);
void SetSampleDensity1(int sampleDensity1_);
void SetSampleDensity2(int sampleDensity2_);
void SetDisplayMethod(DisplayMethod displayMethod_);
void SetShowSeeds(bool showSeeds_);
void SetShowHeads(bool showHeads_);
......@@ -230,6 +231,13 @@ public:
void SetOpacityVarMaxFlag(bool opacityVarMaxFlag_);
void SetTubeDisplayDensity(int tubeDisplayDensity_);
void SetGeomDisplayQuality(DisplayQuality geomDisplayQuality_);
void SetSampleDistance0(double sampleDistance0_);
void SetSampleDistance1(double sampleDistance1_);
void SetSampleDistance2(double sampleDistance2_);
void SetFillInterior(bool fillInterior_);
void SetRandomSamples(bool randomSamples_);
void SetRandomSeed(int randomSeed_);
void SetNumberOfRandomSamples(int numberOfRandomSamples_);
// Property getting methods
SourceType GetSourceType() const;
......@@ -247,16 +255,17 @@ public:
double *GetPlaneNormal();
const double *GetPlaneUpAxis() const;
double *GetPlaneUpAxis();
double GetPlaneRadius() const;
double GetRadius() const;
const double *GetSphereOrigin() const;
double *GetSphereOrigin();
double GetSphereRadius() const;
const double *GetBoxExtents() const;
double *GetBoxExtents();
bool GetUseWholeBox() const;
const doubleVector &GetPointList() const;
doubleVector &GetPointList();
int GetPointDensity() const;
int GetSampleDensity0() const;
int GetSampleDensity1() const;
int GetSampleDensity2() const;
DisplayMethod GetDisplayMethod() const;
bool GetShowSeeds() const;
bool GetShowHeads() const;
......@@ -304,6 +313,13 @@ public:
bool GetOpacityVarMaxFlag() const;
int GetTubeDisplayDensity() const;
DisplayQuality GetGeomDisplayQuality() const;
double GetSampleDistance0() const;
double GetSampleDistance1() const;
double GetSampleDistance2() const;
bool GetFillInterior() const;
bool GetRandomSamples() const;
int GetRandomSeed() const;
int GetNumberOfRandomSamples() const;
// Persistence methods
virtual bool CreateNode(DataNode *node, bool completeSave, bool forceAdd);
......@@ -382,13 +398,14 @@ public:
ID_planeOrigin,
ID_planeNormal,
ID_planeUpAxis,
ID_planeRadius,
ID_radius,
ID_sphereOrigin,
ID_sphereRadius,
ID_boxExtents,
ID_useWholeBox,
ID_pointList,
ID_pointDensity,
ID_sampleDensity0,
ID_sampleDensity1,
ID_sampleDensity2,
ID_displayMethod,
ID_showSeeds,
ID_showHeads,
......@@ -432,6 +449,13 @@ public:
ID_opacityVarMaxFlag,
ID_tubeDisplayDensity,
ID_geomDisplayQuality,
ID_sampleDistance0,
ID_sampleDistance1,
ID_sampleDistance2,
ID_fillInterior,
ID_randomSamples,
ID_randomSeed,
ID_numberOfRandomSamples,
ID__LAST
};
......@@ -445,13 +469,14 @@ private:
double planeOrigin[3];
double planeNormal[3];
double planeUpAxis[3];
double planeRadius;
double radius;
double sphereOrigin[3];
double sphereRadius;
double boxExtents[6];
bool useWholeBox;
doubleVector pointList;
int pointDensity;
int sampleDensity0;
int sampleDensity1;
int sampleDensity2;
int displayMethod;
bool showSeeds;
bool showHeads;
......@@ -495,11 +520,18 @@ private:
bool opacityVarMaxFlag;
int tubeDisplayDensity;
int geomDisplayQuality;
double sampleDistance0;
double sampleDistance1;
double sampleDistance2;
bool fillInterior;
bool randomSamples;
int randomSeed;
int numberOfRandomSamples;
// Static class format string for type map.
static const char *TypeMapFormatString;
static const private_tmfs_t TmfsStruct;
};
#define STREAMLINEATTRIBUTES_TMFS "iddDDDDDDdDdDbd*iibbddiisabbiddiiiiiibsbbddddbbdiddisdddbbii"
#define STREAMLINEATTRIBUTES_TMFS "iddDDDDDDdDDbd*iiiibbddiisabbiddiiiiiibsbbddddbbdiddisdddbbiidddbbii"
#endif
This diff is collapsed.
......@@ -387,6 +387,9 @@ avtStreamlinePlot::EnhanceSpecification(avtContract_p in_contract)
// Hank Childs, Sun Jun 6 11:53:33 CDT 2010
// Change method name from streamline direction to integration direction.
//
// Dave Pugmire, Thu Jun 10 10:44:02 EDT 2010
// New seed sources.
//
// ****************************************************************************
void
......@@ -404,51 +407,48 @@ avtStreamlinePlot::SetAtts(const AttributeGroup *a)
switch (atts.GetSourceType())
{
case StreamlineAttributes::SpecifiedPoint:
streamlineFilter->SetSourceType(STREAMLINE_SOURCE_POINT);
streamlineFilter->SetPointSource(atts.GetPointSource());
break;
case StreamlineAttributes::SpecifiedPointList:
streamlineFilter->SetSourceType(STREAMLINE_SOURCE_POINT_LIST);
streamlineFilter->SetPointListSource(atts.GetPointList());
break;
case StreamlineAttributes::SpecifiedLine:
streamlineFilter->SetSourceType(STREAMLINE_SOURCE_LINE);
streamlineFilter->SetLineSource(atts.GetLineStart(), atts.GetLineEnd());
streamlineFilter->SetPointDensity(atts.GetPointDensity());
streamlineFilter->SetLineSource(atts.GetLineStart(), atts.GetLineEnd(),
atts.GetSampleDensity0(),
atts.GetRandomSamples(), atts.GetRandomSeed(), atts.GetNumberOfRandomSamples());
break;
case StreamlineAttributes::SpecifiedCircle:
streamlineFilter->SetSourceType(STREAMLINE_SOURCE_CIRCLE);
streamlineFilter->SetPlaneSource(atts.GetPlaneOrigin(),
atts.GetPlaneNormal(),
atts.GetPlaneUpAxis(),
atts.GetPlaneRadius());
streamlineFilter->SetPointDensity(atts.GetPointDensity());
break;
case StreamlineAttributes::SpecifiedPlane:
streamlineFilter->SetSourceType(STREAMLINE_SOURCE_PLANE);
streamlineFilter->SetPlaneSource(atts.GetPlaneOrigin(),
atts.GetPlaneNormal(),
atts.GetPlaneUpAxis(),
atts.GetPlaneRadius());
streamlineFilter->SetPointDensity(atts.GetPointDensity());
atts.GetSampleDensity0(), atts.GetSampleDensity1(),
atts.GetSampleDistance0(), atts.GetSampleDistance1(),
atts.GetFillInterior(),
atts.GetRandomSamples(), atts.GetRandomSeed(), atts.GetNumberOfRandomSamples());
break;
case StreamlineAttributes::SpecifiedCircle:
streamlineFilter->SetCircleSource(atts.GetPlaneOrigin(),
atts.GetPlaneNormal(),
atts.GetPlaneUpAxis(),
atts.GetRadius(),
atts.GetSampleDensity0(), atts.GetSampleDensity1(),
atts.GetFillInterior(),
atts.GetRandomSamples(), atts.GetRandomSeed(), atts.GetNumberOfRandomSamples());
break;
case StreamlineAttributes::SpecifiedSphere:
streamlineFilter->SetSourceType(STREAMLINE_SOURCE_SPHERE);
streamlineFilter->SetSphereSource(atts.GetSphereOrigin(),
atts.GetSphereRadius());
streamlineFilter->SetPointDensity(atts.GetPointDensity());
streamlineFilter->SetSphereSource(atts.GetSphereOrigin(), atts.GetRadius(),
atts.GetSampleDensity0(), atts.GetSampleDensity1(), atts.GetSampleDensity2(),
atts.GetFillInterior(),
atts.GetRandomSamples(), atts.GetRandomSeed(), atts.GetNumberOfRandomSamples());
break;
case StreamlineAttributes::SpecifiedBox:
streamlineFilter->SetSourceType(STREAMLINE_SOURCE_BOX);
streamlineFilter->SetBoxSource(atts.GetBoxExtents());
streamlineFilter->SetUseWholeBox(atts.GetUseWholeBox());
streamlineFilter->SetPointDensity(atts.GetPointDensity());
streamlineFilter->SetBoxSource(atts.GetBoxExtents(),atts.GetUseWholeBox(),
atts.GetSampleDensity0(), atts.GetSampleDensity1(), atts.GetSampleDensity2(),
atts.GetFillInterior(),
atts.GetRandomSamples(), atts.GetRandomSeed(), atts.GetNumberOfRandomSamples());
break;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment