shapeworks::FreeFormConstraint
#include <FreeFormConstraint.h>
Inherits from shapeworks::Constraint
Public Functions
Name | |
---|---|
FreeFormConstraint() | |
void | setMesh(std::shared_ptr< shapeworks::Mesh > mesh) Sets the mesh that defines the FFC. |
std::shared_ptr< shapeworks::Mesh > | getMesh() Returns the mesh that defines the FFC. |
bool | readyForOptimize() const Prepares for optimize. |
virtual bool | isViolated(const Eigen::Vector3d & pt) const override Returns if pt in Eigen format is violated by the constraint. |
virtual void | print() const override Prints the constraint neatly. |
virtual Eigen::Vector3d | constraintGradient(const Eigen::Vector3d & pt) const override Returns the gradient of the constraint. |
virtual double | constraintEval(const Eigen::Vector3d & pt) const override Returns the evaluation on the constraint, i.e. the signed distance to the constraint boundary. |
void | setDefinition(vtkSmartPointer< vtkPolyData > polyData) Set polydata where per-vertex free form constraint definition exists. |
vtkSmartPointer< vtkPolyData > | getDefinition() Get polydata where per-vertex free form constraint definition exists. |
void | applyToPolyData(vtkSmartPointer< vtkPolyData > polyData) Apply the free form constraint to a polydata. |
std::vector< std::vector< Eigen::Vector3d > > & | boundaries() |
Eigen::Vector3d | getQueryPoint() |
void | setQueryPoint(Eigen::Vector3d queryPoint) |
void | computeBoundaries() |
void | setInoutPolyData(vtkSmartPointer< vtkPolyData > polyData) Set the in/out polydata. |
vtkSmartPointer< vtkPolyData > | getInoutPolyData() Get the in/out polydata. |
void | createInoutPolyData() Create the in/out poly data from the definition poly data. |
bool | isSet() Return if this FFC is set or not. |
void | setPainted(bool painted) Set if this FFC has paint on it or not. |
void | reset() Reset to initial state. |
void | computeGradientFields(std::shared_ptr< Mesh > mesh) Compute gradient fields for a mesh. |
void | convertLegacyFFC(vtkSmartPointer< vtkPolyData > polyData) Convert legacy FFC to new format. |
Additional inherited members
Public Functions inherited from shapeworks::Constraint
Name | |
---|---|
void | setMus(std::vector< double > inmu) Initializes mu. |
std::vector< double > | getMus() Gets mu. |
void | updateMu(const Eigen::Vector3d & pt, double C, size_t index) Updates the value of mu according to the augmented lagrangian update. |
Eigen::Vector3d | lagragianGradient(const Eigen::Vector3d & pt, double C, size_t index) const Computes the lagrangian gradient based on lagrangian inequality equations. NOTE: Not actually lagrangian. We are using quadratic penalty and not lagrangian because it works better. |
Protected Functions inherited from shapeworks::Constraint
Name | |
---|---|
int | sgn(double val) Returns the sign of the double. |
Protected Attributes inherited from shapeworks::Constraint
Name | |
---|---|
std::vector< double > | mus_ Mu is the lagrangian momentum term. |
Detailed Description
class shapeworks::FreeFormConstraint;
Encapsulate functionality related to free-form constraints (FFC). Inherits from Constraint. See [Constraint.h] for more information
Public Functions Documentation
function FreeFormConstraint
inline FreeFormConstraint()
function setMesh
inline void setMesh(
std::shared_ptr< shapeworks::Mesh > mesh
)
Sets the mesh that defines the FFC.
function getMesh
inline std::shared_ptr< shapeworks::Mesh > getMesh()
Returns the mesh that defines the FFC.
function readyForOptimize
bool readyForOptimize() const
Prepares for optimize.
function isViolated
virtual bool isViolated(
const Eigen::Vector3d & pt
) const override
Returns if pt in Eigen format is violated by the constraint.
Reimplements: shapeworks::Constraint::isViolated
function print
inline virtual void print() const override
Prints the constraint neatly.
Reimplements: shapeworks::Constraint::print
function constraintGradient
inline virtual Eigen::Vector3d constraintGradient(
const Eigen::Vector3d & pt
) const override
Returns the gradient of the constraint.
Reimplements: shapeworks::Constraint::constraintGradient
function constraintEval
inline virtual double constraintEval(
const Eigen::Vector3d & pt
) const override
Returns the evaluation on the constraint, i.e. the signed distance to the constraint boundary.
Reimplements: shapeworks::Constraint::constraintEval
function setDefinition
void setDefinition(
vtkSmartPointer< vtkPolyData > polyData
)
Set polydata where per-vertex free form constraint definition exists.
function getDefinition
inline vtkSmartPointer< vtkPolyData > getDefinition()
Get polydata where per-vertex free form constraint definition exists.
function applyToPolyData
void applyToPolyData(
vtkSmartPointer< vtkPolyData > polyData
)
Apply the free form constraint to a polydata.
function boundaries
std::vector< std::vector< Eigen::Vector3d > > & boundaries()
Deprecated:
Access the set of boundaries
function getQueryPoint
inline Eigen::Vector3d getQueryPoint()
Deprecated:
Get query (inside) point
function setQueryPoint
inline void setQueryPoint(
Eigen::Vector3d queryPoint
)
Deprecated:
Set query (inside) point
function computeBoundaries
void computeBoundaries()
Deprecated:
Compute boundaries from definition polydata with ffc_paint scalars
function setInoutPolyData
inline void setInoutPolyData(
vtkSmartPointer< vtkPolyData > polyData
)
Set the in/out polydata.
function getInoutPolyData
inline vtkSmartPointer< vtkPolyData > getInoutPolyData()
Get the in/out polydata.
function createInoutPolyData
void createInoutPolyData()
Create the in/out poly data from the definition poly data.
function isSet
bool isSet()
Return if this FFC is set or not.
function setPainted
void setPainted(
bool painted
)
Set if this FFC has paint on it or not.
function reset
void reset()
Reset to initial state.
function computeGradientFields
void computeGradientFields(
std::shared_ptr< Mesh > mesh
)
Compute gradient fields for a mesh.
function convertLegacyFFC
void convertLegacyFFC(
vtkSmartPointer< vtkPolyData > polyData
)
Convert legacy FFC to new format.
Updated on 2024-11-11 at 19:51:45 +0000