-// Copyright (C) 2014-2020 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2024 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include <TopoDS.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopExp_Explorer.hxx>
-#include <Prs3d_Root.hxx>
#include <Graphic3d_Text.hxx>
-
+#include <Graphic3d_AspectText3d.hxx>
IMPLEMENT_STANDARD_RTTIEXT(PartSet_FieldStepPrs, ViewerData_AISShape);
QStringList aValues = strings();
AttributeSelectionListPtr aSelList =
aData->selectionList(CollectionPlugin_Field::SELECTED_ID());
- Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup(thePrs);
+ Handle(Graphic3d_Group) aGroup = thePrs->NewGroup();
for (int i = 0; i < aSelList->size(); i++) {
AttributeSelectionPtr aSelection = aSelList->value(i);
GeomShapePtr aShapePtr = aSelection->value();
if (!triangulation.IsNull() && triangulation->HasUVNodes()) {
gp_XY C(0, 0);
double A = 0;
- const TColgp_Array1OfPnt2d& uvArray = triangulation->UVNodes();
- const Poly_Array1OfTriangle& trias = triangulation->Triangles();
int n1, n2, n3;
- for (int iT = trias.Lower(); iT <= trias.Upper(); ++iT) {
- trias(iT).Get(n1, n2, n3);
- const gp_Pnt2d& uv1 = uvArray(n1);
- const gp_Pnt2d& uv2 = uvArray(n2);
- const gp_Pnt2d& uv3 = uvArray(n3);
+ for (int iT = 1; iT <= triangulation->NbTriangles(); ++iT) {
+ triangulation->Triangle(iT).Get(n1, n2, n3);
+ const gp_Pnt2d& uv1 = triangulation->UVNode(n1);
+ const gp_Pnt2d& uv2 = triangulation->UVNode(n2);
+ const gp_Pnt2d& uv3 = triangulation->UVNode(n3);
double a = 0.5 * sqrt((uv1.X() - uv3.X()) * (uv2.Y() - uv1.Y()) -
(uv1.X() - uv2.X()) * (uv3.Y() - uv1.Y()));
C += (uv1.XY() + uv2.XY() + uv3.XY()) / 3. * a;