All: Reformat according to new standard

This commit is contained in:
pre-commit-ci[bot]
2025-11-11 13:49:01 +01:00
committed by Kacper Donat
parent eafd18dac0
commit 25c3ba7338
2390 changed files with 154630 additions and 115818 deletions

View File

@@ -21,21 +21,21 @@
***************************************************************************/
# include <sstream>
# include <QAction>
# include <QFileInfo>
# include <QImage>
# include <QMenu>
# include <QString>
# include <QSvgRenderer>
# include <Inventor/nodes/SoCoordinate3.h>
# include <Inventor/nodes/SoFaceSet.h>
# include <Inventor/nodes/SoLightModel.h>
# include <Inventor/nodes/SoMaterial.h>
# include <Inventor/nodes/SoSeparator.h>
# include <Inventor/nodes/SoShapeHints.h>
# include <Inventor/nodes/SoTexture2.h>
# include <Inventor/nodes/SoTextureCoordinate2.h>
#include <sstream>
#include <QAction>
#include <QFileInfo>
#include <QImage>
#include <QMenu>
#include <QString>
#include <QSvgRenderer>
#include <Inventor/nodes/SoCoordinate3.h>
#include <Inventor/nodes/SoFaceSet.h>
#include <Inventor/nodes/SoLightModel.h>
#include <Inventor/nodes/SoMaterial.h>
#include <Inventor/nodes/SoSeparator.h>
#include <Inventor/nodes/SoShapeHints.h>
#include <Inventor/nodes/SoTexture2.h>
#include <Inventor/nodes/SoTextureCoordinate2.h>
#include <App/Document.h>
@@ -52,11 +52,11 @@ using namespace Gui;
PROPERTY_SOURCE(Gui::ViewProviderImagePlane, Gui::ViewProviderGeometryObject)
const char* ViewProviderImagePlane::LightingEnums[]= {"One side", "Two side", nullptr};
const char* ViewProviderImagePlane::LightingEnums[] = {"One side", "Two side", nullptr};
ViewProviderImagePlane::ViewProviderImagePlane()
{
ADD_PROPERTY_TYPE(Lighting,(1L), "Object Style", App::Prop_None, "Set object lighting.");
ADD_PROPERTY_TYPE(Lighting, (1L), "Object Style", App::Prop_None, "Set object lighting.");
Lighting.setEnums(LightingEnums);
texture = new SoTexture2;
@@ -82,7 +82,7 @@ ViewProviderImagePlane::~ViewProviderImagePlane()
shapeHints->unref();
}
void ViewProviderImagePlane::attach(App::DocumentObject *pcObj)
void ViewProviderImagePlane::attach(App::DocumentObject* pcObj)
{
ViewProviderGeometryObject::attach(pcObj);
@@ -92,11 +92,11 @@ void ViewProviderImagePlane::attach(App::DocumentObject *pcObj)
SoSeparator* shading = new SoSeparator;
shading->addChild(pcCoords);
SoTextureCoordinate2 *textCoord = new SoTextureCoordinate2;
textCoord->point.set1Value(0,0,0);
textCoord->point.set1Value(1,1,0);
textCoord->point.set1Value(2,1,1);
textCoord->point.set1Value(3,0,1);
SoTextureCoordinate2* textCoord = new SoTextureCoordinate2;
textCoord->point.set1Value(0, 0, 0);
textCoord->point.set1Value(1, 1, 0);
textCoord->point.set1Value(2, 1, 1);
textCoord->point.set1Value(3, 0, 1);
shading->addChild(textCoord);
// texture
@@ -107,12 +107,12 @@ void ViewProviderImagePlane::attach(App::DocumentObject *pcObj)
shading->addChild(pcShapeMaterial);
// plane
pcCoords->point.set1Value(0,0,0,0);
pcCoords->point.set1Value(1,1,0,0);
pcCoords->point.set1Value(2,1,1,0);
pcCoords->point.set1Value(3,0,1,0);
SoFaceSet *faceset = new SoFaceSet;
faceset->numVertices.set1Value(0,4);
pcCoords->point.set1Value(0, 0, 0, 0);
pcCoords->point.set1Value(1, 1, 0, 0);
pcCoords->point.set1Value(2, 1, 1, 0);
pcCoords->point.set1Value(3, 0, 1, 0);
SoFaceSet* faceset = new SoFaceSet;
faceset->numVertices.set1Value(0, 4);
shading->addChild(faceset);
addDisplayMaskMode(shading, "Shading");
@@ -154,10 +154,12 @@ std::vector<std::string> ViewProviderImagePlane::getDisplayModes() const
void ViewProviderImagePlane::onChanged(const App::Property* prop)
{
if (prop == &Lighting) {
if (Lighting.getValue() == 0)
if (Lighting.getValue() == 0) {
shapeHints->vertexOrdering = SoShapeHints::UNKNOWN_ORDERING;
else
}
else {
shapeHints->vertexOrdering = SoShapeHints::COUNTERCLOCKWISE;
}
}
ViewProviderGeometryObject::onChanged(prop);
}
@@ -167,9 +169,7 @@ void ViewProviderImagePlane::setupContextMenu(QMenu* menu, QObject* receiver, co
Gui::ActionFunction* func = new Gui::ActionFunction(menu);
QAction* action = menu->addAction(QObject::tr("Change Image"));
action->setIcon(QIcon(QLatin1String("images:image-scaling.svg")));
func->trigger(action, [this](){
this->manipulateImage();
});
func->trigger(action, [this]() { this->manipulateImage(); });
ViewProviderGeometryObject::setupContextMenu(menu, receiver, member);
}
@@ -189,10 +189,10 @@ void ViewProviderImagePlane::manipulateImage()
void ViewProviderImagePlane::resizePlane(float xsize, float ysize)
{
pcCoords->point.set1Value(0,-(xsize/2),-(ysize/2),0.0);
pcCoords->point.set1Value(1,+(xsize/2),-(ysize/2),0.0);
pcCoords->point.set1Value(2,+(xsize/2),+(ysize/2),0.0);
pcCoords->point.set1Value(3,-(xsize/2),+(ysize/2),0.0);
pcCoords->point.set1Value(0, -(xsize / 2), -(ysize / 2), 0.0);
pcCoords->point.set1Value(1, +(xsize / 2), -(ysize / 2), 0.0);
pcCoords->point.set1Value(2, +(xsize / 2), +(ysize / 2), 0.0);
pcCoords->point.set1Value(3, -(xsize / 2), +(ysize / 2), 0.0);
}
void ViewProviderImagePlane::loadImage()