All: Reformat according to new standard
This commit is contained in:
committed by
Kacper Donat
parent
eafd18dac0
commit
25c3ba7338
@@ -21,17 +21,17 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
# include <Inventor/nodes/SoAsciiText.h>
|
||||
# include <Inventor/nodes/SoCoordinate3.h>
|
||||
# include <Inventor/nodes/SoFaceSet.h>
|
||||
# include <Inventor/nodes/SoIndexedLineSet.h>
|
||||
# include <Inventor/nodes/SoMaterial.h>
|
||||
# include <Inventor/nodes/SoPickStyle.h>
|
||||
# include <Inventor/nodes/SoSeparator.h>
|
||||
# include <Inventor/nodes/SoShapeHints.h>
|
||||
# include <Inventor/nodes/SoTranslation.h>
|
||||
# include <Inventor/nodes/SoSwitch.h>
|
||||
# include <Inventor/SbColor.h>
|
||||
#include <Inventor/nodes/SoAsciiText.h>
|
||||
#include <Inventor/nodes/SoCoordinate3.h>
|
||||
#include <Inventor/nodes/SoFaceSet.h>
|
||||
#include <Inventor/nodes/SoIndexedLineSet.h>
|
||||
#include <Inventor/nodes/SoMaterial.h>
|
||||
#include <Inventor/nodes/SoPickStyle.h>
|
||||
#include <Inventor/nodes/SoSeparator.h>
|
||||
#include <Inventor/nodes/SoShapeHints.h>
|
||||
#include <Inventor/nodes/SoTranslation.h>
|
||||
#include <Inventor/nodes/SoSwitch.h>
|
||||
#include <Inventor/SbColor.h>
|
||||
|
||||
#include <App/Datums.h>
|
||||
#include <Gui/ViewParams.h>
|
||||
@@ -51,7 +51,8 @@ using namespace Gui;
|
||||
PROPERTY_SOURCE(Gui::ViewProviderPlane, Gui::ViewProviderDatum)
|
||||
|
||||
|
||||
ViewProviderPlane::ViewProviderPlane() : SelectionObserver(true)
|
||||
ViewProviderPlane::ViewProviderPlane()
|
||||
: SelectionObserver(true)
|
||||
{
|
||||
sPixmap = "Std_Plane";
|
||||
lineThickness = 1.0;
|
||||
@@ -61,7 +62,8 @@ ViewProviderPlane::ViewProviderPlane() : SelectionObserver(true)
|
||||
|
||||
ViewProviderPlane::~ViewProviderPlane() = default;
|
||||
|
||||
void ViewProviderPlane::attach(App::DocumentObject * obj) {
|
||||
void ViewProviderPlane::attach(App::DocumentObject* obj)
|
||||
{
|
||||
ViewProviderDatum::attach(obj);
|
||||
|
||||
std::string role = getRole();
|
||||
@@ -72,7 +74,7 @@ void ViewProviderPlane::attach(App::DocumentObject * obj) {
|
||||
// Can't use transparency because of https://github.com/FreeCAD/FreeCAD/issues/18395
|
||||
// When this issue is fixed then we can use the below and remove the material here
|
||||
// and faceSeparator...
|
||||
//ShapeAppearance.setTransparency(0.8);
|
||||
// ShapeAppearance.setTransparency(0.8);
|
||||
auto material = new SoMaterial();
|
||||
material->transparency.setValue(0.85f);
|
||||
|
||||
@@ -94,7 +96,7 @@ void ViewProviderPlane::attach(App::DocumentObject * obj) {
|
||||
|
||||
auto lineSeparator = new SoSeparator();
|
||||
auto pLines = new SoIndexedLineSet();
|
||||
static const int32_t lines[6] = { 0, 1, 2, 3, 0, -1 };
|
||||
static const int32_t lines[6] = {0, 1, 2, 3, 0, -1};
|
||||
pLines->coordIndex.setNum(6);
|
||||
pLines->coordIndex.setValues(0, 6, lines);
|
||||
|
||||
@@ -159,7 +161,8 @@ void ViewProviderPlane::setLabelVisibility(bool val)
|
||||
void ViewProviderPlane::onSelectionChanged(const SelectionChanges&)
|
||||
{
|
||||
isSelected = Gui::Selection().isSelected(getObject());
|
||||
isHovered = Gui::Selection().getPreselection().Object.getSubObject() == getObject() || Gui::Selection().getPreselection().Object.getObject() == getObject();
|
||||
isHovered = Gui::Selection().getPreselection().Object.getSubObject() == getObject()
|
||||
|| Gui::Selection().getPreselection().Object.getObject() == getObject();
|
||||
|
||||
updatePlaneSize();
|
||||
}
|
||||
@@ -184,14 +187,15 @@ void ViewProviderPlane::updatePlaneSize()
|
||||
verts[1] = SbVec3f(size, offset, 0);
|
||||
verts[2] = SbVec3f(offset, offset, 0);
|
||||
verts[3] = SbVec3f(offset, size, 0);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
verts[0] = SbVec3f(size, size, 0);
|
||||
verts[1] = SbVec3f(size, -size, 0);
|
||||
verts[2] = SbVec3f(-size, -size, 0);
|
||||
verts[3] = SbVec3f(-size, size, 0);
|
||||
}
|
||||
|
||||
pTextTranslation->translation.setValue(verts[0] / 2 - SbVec3f(2, 6, 0)); // NOLINT
|
||||
pTextTranslation->translation.setValue(verts[0] / 2 - SbVec3f(2, 6, 0)); // NOLINT
|
||||
pCoords->point.setNum(4);
|
||||
pCoords->point.setValues(0, 4, verts);
|
||||
}
|
||||
@@ -200,13 +204,13 @@ unsigned long ViewProviderPlane::getColor(const std::string& role) const
|
||||
{
|
||||
auto planesRoles = App::LocalCoordinateSystem::PlaneRoles;
|
||||
if (role == planesRoles[0]) {
|
||||
return ViewParams::instance()->getAxisZColor(); // XY-plane
|
||||
return ViewParams::instance()->getAxisZColor(); // XY-plane
|
||||
}
|
||||
else if (role == planesRoles[1]) {
|
||||
return ViewParams::instance()->getAxisYColor(); // XZ-plane
|
||||
return ViewParams::instance()->getAxisYColor(); // XZ-plane
|
||||
}
|
||||
else if (role == planesRoles[2]) {
|
||||
return ViewParams::instance()->getAxisXColor(); // YZ-plane
|
||||
return ViewParams::instance()->getAxisXColor(); // YZ-plane
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user