-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GUI] Add ConstraintAttachButtonSetting (#4601)
* Add ConstraintAttachButtonSetting to allow configuraiton of lagrangian based mouse interaction directly in the scene * add example scene and remove alias * Add comment to the class declaration in the header * Added comment into the scene file * Update Sofa/GUI/Component/src/sofa/gui/component/ConstraintAttachButtonSetting.h Co-authored-by: Alex Bilger <[email protected]> * Update Sofa/GUI/Component/src/sofa/gui/component/ConstraintAttachButtonSetting.cpp Co-authored-by: Alex Bilger <[email protected]> --------- Co-authored-by: Alex Bilger <[email protected]> Co-authored-by: Frederick Roy <[email protected]>
- Loading branch information
1 parent
1df6701
commit 7d4f1e2
Showing
4 changed files
with
83 additions
and
0 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
35 changes: 35 additions & 0 deletions
35
Sofa/GUI/Component/src/sofa/gui/component/ConstraintAttachButtonSetting.cpp
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/****************************************************************************** | ||
* SOFA, Simulation Open-Framework Architecture * | ||
* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * | ||
* * | ||
* This program is free software; you can redistribute it and/or modify it * | ||
* under the terms of the GNU Lesser General Public License as published by * | ||
* the Free Software Foundation; either version 2.1 of the License, or (at * | ||
* your option) any later version. * | ||
* * | ||
* This program is distributed in the hope that it will be useful, but WITHOUT * | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * | ||
* for more details. * | ||
* * | ||
* You should have received a copy of the GNU Lesser General Public License * | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. * | ||
******************************************************************************* | ||
* Authors: The SOFA Team and external contributors (see Authors.txt) * | ||
* * | ||
* Contact information: [email protected] * | ||
******************************************************************************/ | ||
|
||
#include <sofa/gui/component/ConstraintAttachButtonSetting.h> | ||
#include <sofa/core/visual/VisualParams.h> | ||
#include <sofa/core/ObjectFactory.h> | ||
|
||
namespace sofa::gui::component | ||
{ | ||
|
||
int ConstraintAttachButtonSettingClass = core::RegisterObject("Attach an object to the mouse using lagrangian multiplier") | ||
.add< ConstraintAttachButtonSetting >(); | ||
|
||
|
||
|
||
} // namespace sofa::gui::component |
45 changes: 45 additions & 0 deletions
45
Sofa/GUI/Component/src/sofa/gui/component/ConstraintAttachButtonSetting.h
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/****************************************************************************** | ||
* SOFA, Simulation Open-Framework Architecture * | ||
* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * | ||
* * | ||
* This program is free software; you can redistribute it and/or modify it * | ||
* under the terms of the GNU Lesser General Public License as published by * | ||
* the Free Software Foundation; either version 2.1 of the License, or (at * | ||
* your option) any later version. * | ||
* * | ||
* This program is distributed in the hope that it will be useful, but WITHOUT * | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * | ||
* for more details. * | ||
* * | ||
* You should have received a copy of the GNU Lesser General Public License * | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. * | ||
******************************************************************************* | ||
* Authors: The SOFA Team and external contributors (see Authors.txt) * | ||
* * | ||
* Contact information: [email protected] * | ||
******************************************************************************/ | ||
#pragma once | ||
|
||
#include <sofa/gui/component/config.h> | ||
|
||
#include <sofa/core/objectmodel/ConfigurationSetting.h> | ||
#include <sofa/component/setting/MouseButtonSetting.h> | ||
|
||
namespace sofa::gui::component | ||
{ | ||
|
||
/***** | ||
* This component modifies the mouse picking behavior in the GUI | ||
* and set it at the beginning to Lagrangian-based contraints | ||
* It doesn't have any parameter because its only presence is sufficient. | ||
*****/ | ||
class SOFA_GUI_COMPONENT_API ConstraintAttachButtonSetting: public sofa::component::setting::MouseButtonSetting | ||
{ | ||
public: | ||
SOFA_CLASS(ConstraintAttachButtonSetting,MouseButtonSetting); | ||
std::string getOperationType() override {return "ConstraintAttach";} | ||
|
||
}; | ||
|
||
} // namespace sofa::gui::component |
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