forked from sofa-framework/sofa
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Topology.Mapping] Edge2QuadTopologicalMapping: use States directly (s…
…ofa-framework#4388) * use directly states for edge2quad * apply to example scene * clean/format includes
- Loading branch information
Showing
3 changed files
with
11 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,25 +20,16 @@ | |
* Contact information: [email protected] * | ||
******************************************************************************/ | ||
#include <sofa/component/topology/mapping/Edge2QuadTopologicalMapping.h> | ||
#include <sofa/core/visual/VisualParams.h> | ||
|
||
#include <sofa/core/ObjectFactory.h> | ||
|
||
#include <sofa/component/topology/container/dynamic/QuadSetTopologyModifier.h> | ||
#include <sofa/component/topology/container/dynamic/QuadSetTopologyContainer.h> | ||
|
||
#include <sofa/core/topology/TopologyChange.h> | ||
|
||
#include <sofa/type/Vec.h> | ||
#include <map> | ||
#include <sofa/defaulttype/VecTypes.h> | ||
|
||
#include <sofa/core/behavior/MechanicalState.h> | ||
|
||
#include <cmath> | ||
|
||
#include <sofa/defaulttype/RigidTypes.h> | ||
|
||
#include <sofa/component/topology/container/dynamic/QuadSetTopologyModifier.h> | ||
#include <sofa/component/topology/container/dynamic/QuadSetTopologyContainer.h> | ||
|
||
|
||
namespace sofa::component::topology::mapping | ||
{ | ||
|
@@ -112,8 +103,8 @@ void Edge2QuadTopologicalMapping::init() | |
|
||
|
||
// INITIALISATION of QUADULAR mesh from EDGE mesh : | ||
const core::behavior::MechanicalState<Rigid3Types>* from_mstate = dynamic_cast<core::behavior::MechanicalState<Rigid3Types>*>(fromModel->getContext()->getMechanicalState()); | ||
core::behavior::MechanicalState<Vec3Types>* to_mstate = dynamic_cast<core::behavior::MechanicalState<Vec3Types>*>(toModel->getContext()->getMechanicalState()); | ||
const core::State<Rigid3Types>* from_mstate = dynamic_cast<core::State<Rigid3Types>*>(fromModel->getContext()->getState()); | ||
core::State<Vec3Types>* to_mstate = dynamic_cast<core::State<Vec3Types>*>(toModel->getContext()->getState()); | ||
|
||
if (fromModel) | ||
{ | ||
|
@@ -299,8 +290,8 @@ void Edge2QuadTopologicalMapping::init() | |
} | ||
else | ||
{ | ||
// Check type Rigid3 of input mechanical object (required) | ||
msg_error() << "Mechanical object associated with the input is not of type Rigid. Edge2QuadTopologicalMapping only supports Rigid3Types to Vec3Types"; | ||
// Check type Rigid3 of input state object (required) | ||
msg_error() << "State object associated with the input is not of type Rigid. Edge2QuadTopologicalMapping only supports Rigid3Types to Vec3Types"; | ||
d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters