added: allow instancing scalar fields directly from a surface/volume
This commit is contained in:
@@ -49,6 +49,14 @@ LRSplineField2D::LRSplineField2D (const ASMu2D* patch,
|
||||
}
|
||||
|
||||
|
||||
LRSplineField2D::LRSplineField2D (const LR::LRSplineSurface* srf,
|
||||
const RealArray& v, const char* name)
|
||||
: FieldBase(name), basis(srf), surf(srf)
|
||||
{
|
||||
values = v;
|
||||
}
|
||||
|
||||
|
||||
double LRSplineField2D::valueNode (size_t node) const
|
||||
{
|
||||
return node > 0 && node <= nno ? values(node) : 0.0;
|
||||
|
||||
@@ -43,6 +43,12 @@ public:
|
||||
//! \param[in] name Name of spline field
|
||||
LRSplineField2D(const ASMu2D* patch, const RealArray& v,
|
||||
char basis = 1, char cmp = 1, const char* name = nullptr);
|
||||
//! \brief Construct directly from surface.
|
||||
//! \param[in] srf The spline surface to use
|
||||
//! \param[in] v Array of control point field values
|
||||
//! \param[in] name Name of spline field
|
||||
LRSplineField2D(const LR::LRSplineSurface* srf, const RealArray& v,
|
||||
const char* name = nullptr);
|
||||
//! \brief Empty destructor.
|
||||
virtual ~LRSplineField2D() {}
|
||||
|
||||
|
||||
@@ -49,6 +49,14 @@ LRSplineField3D::LRSplineField3D (const ASMu3D* patch,
|
||||
}
|
||||
|
||||
|
||||
LRSplineField3D::LRSplineField3D (const LR::LRSplineVolume* svol,
|
||||
const RealArray& v, const char* name)
|
||||
: FieldBase(name), basis(svol), vol(svol)
|
||||
{
|
||||
values = v;
|
||||
}
|
||||
|
||||
|
||||
double LRSplineField3D::valueNode (size_t node) const
|
||||
{
|
||||
return node > 0 && node <= nno ? values(node) : 0.0;
|
||||
|
||||
@@ -43,6 +43,12 @@ public:
|
||||
//! \param[in] name Name of spline field
|
||||
LRSplineField3D(const ASMu3D* patch, const RealArray& v,
|
||||
char basis = 1, char cmp = 1, const char* name = nullptr);
|
||||
//! \brief Construct directly from volume.
|
||||
//! \param[in] svol The spline volume to use
|
||||
//! \param[in] v Array of control point field values
|
||||
//! \param[in] name Name of spline field
|
||||
LRSplineField3D(const LR::LRSplineVolume* svol, const RealArray& v,
|
||||
const char* name = nullptr);
|
||||
//! \brief Empty destructor.
|
||||
virtual ~LRSplineField3D() {}
|
||||
|
||||
|
||||
@@ -57,6 +57,14 @@ SplineField2D::SplineField2D (const ASMs2D* patch,
|
||||
}
|
||||
|
||||
|
||||
SplineField2D::SplineField2D (const Go::SplineSurface* srf,
|
||||
const RealArray& v, const char* name)
|
||||
: FieldBase(name), basis(srf), surf(srf)
|
||||
{
|
||||
values = v;
|
||||
}
|
||||
|
||||
|
||||
double SplineField2D::valueNode (size_t node) const
|
||||
{
|
||||
return node > 0 && node <= nno ? values(node) : 0.0;
|
||||
|
||||
@@ -37,11 +37,16 @@ public:
|
||||
//! \param[in] patch The spline patch on which the field is to be defined
|
||||
//! \param[in] v Array of control point field values
|
||||
//! \param[in] basis Basis to use from patch
|
||||
//! \param[in] cmp Component to use from source field.
|
||||
//! Pass 0 to use vector as-is.
|
||||
//! \param[in] cmp Component to use from source field. Pass 0 to use vector as-is.
|
||||
//! \param[in] name Name of spline field
|
||||
SplineField2D(const ASMs2D* patch, const RealArray& v,
|
||||
char basis = 1, char cmp = 1, const char* name = nullptr);
|
||||
//! \brief Construct directly from surface.
|
||||
//! \param[in] srf The spline surface to use
|
||||
//! \param[in] v Array of control point field values
|
||||
//! \param[in] name Name of spline field
|
||||
SplineField2D(const Go::SplineSurface* srf, const RealArray& v,
|
||||
const char* name = nullptr);
|
||||
//! \brief Empty destructor.
|
||||
virtual ~SplineField2D() {}
|
||||
|
||||
|
||||
@@ -58,6 +58,14 @@ SplineField3D::SplineField3D (const ASMs3D* patch,
|
||||
}
|
||||
|
||||
|
||||
SplineField3D::SplineField3D (const Go::SplineVolume* svol,
|
||||
const RealArray& v, const char* name)
|
||||
: FieldBase(name), basis(svol), vol(svol)
|
||||
{
|
||||
values = v;
|
||||
}
|
||||
|
||||
|
||||
double SplineField3D::valueNode (size_t node) const
|
||||
{
|
||||
return node > 0 && node <= nno ? values(node) : 0.0;
|
||||
|
||||
@@ -42,6 +42,12 @@ public:
|
||||
//! \param[in] name Name of spline field
|
||||
SplineField3D(const ASMs3D* patch, const RealArray& v,
|
||||
char basis = 1, char cmp = 1, const char* name = nullptr);
|
||||
//! \brief Construct directly from volume.
|
||||
//! \param[in] svol The spline volume to use
|
||||
//! \param[in] v Array of control point field values
|
||||
//! \param[in] name Name of spline field
|
||||
SplineField3D(const Go::SplineVolume* svol, const RealArray& v,
|
||||
const char* name = nullptr);
|
||||
//! \brief Empty destructor.
|
||||
virtual ~SplineField3D() {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user