|
1 | | -/*----------------------------------------------------------------------------*/ |
2 | | -#include "Group/Group3D.h" |
| 1 | +#include "Group/Group0D.h" |
3 | 2 | #include "Internal/Context.h" |
4 | | -#include "Internal/EntitiesHelper.h" |
5 | | -#include "Geom/Volume.h" |
6 | | -#include "Mesh/Volume.h" |
7 | | -#include "Utils/SerializedRepresentation.h" |
8 | | -/*----------------------------------------------------------------------------*/ |
9 | | -#include <TkUtil/WarningLog.h> |
10 | | -/*----------------------------------------------------------------------------*/ |
11 | | -namespace Mgx3D { |
12 | 3 | /*----------------------------------------------------------------------------*/ |
13 | | -namespace Group { |
| 4 | +namespace Mgx3D::Group { |
14 | 5 | /*----------------------------------------------------------------------------*/ |
15 | 6 | const char* Group3D::typeNameGroup3D = "Group3D"; |
16 | 7 | /*----------------------------------------------------------------------------*/ |
17 | | -Group3D::Group3D(Internal::Context& ctx, |
18 | | - const std::string & nom, |
19 | | - bool isDefaultGroup, uint level) |
20 | | -: GroupEntity (ctx, |
21 | | - ctx.newProperty(Utils::Entity::Group3D, nom), |
22 | | - ctx.newDisplayProperties(Utils::Entity::Group3D), |
23 | | - isDefaultGroup, level) |
24 | | -{ |
25 | | -} |
26 | | -/*----------------------------------------------------------------------------*/ |
27 | | -Group3D::~Group3D() |
| 8 | +Group3D::Group3D( |
| 9 | + Internal::Context& ctx, |
| 10 | + const std::string & nom, |
| 11 | + bool isDefaultGroup, |
| 12 | + uint level) |
| 13 | +: GroupEntity( |
| 14 | + ctx, |
| 15 | + ctx.newProperty(Utils::Entity::Group3D, nom), |
| 16 | + ctx.newDisplayProperties(Utils::Entity::Group3D), |
| 17 | + isDefaultGroup, |
| 18 | + level) |
28 | 19 | { |
29 | 20 | } |
30 | 21 | /*----------------------------------------------------------------------------*/ |
31 | | -Utils::SerializedRepresentation* Group3D:: |
32 | | -getDescription (bool alsoComputed) const |
33 | | -{ |
34 | | - std::unique_ptr<Utils::SerializedRepresentation> description ( |
35 | | - GroupEntity::getDescription (alsoComputed)); |
36 | | - |
37 | | - std::vector<Geom::Volume*> volumes = getFilteredEntities<Geom::Volume>(); |
38 | | - if (!volumes.empty()){ |
39 | | - Utils::SerializedRepresentation sr ("Volumes géométriques", |
40 | | - TkUtil::NumericConversions::toStr(volumes.size())); |
41 | | - for (Geom::Volume* vol : volumes) |
42 | | - sr.addProperty(Utils::SerializedRepresentation::Property(vol->getName ( ), *vol)); |
43 | | - description->addPropertiesSet(sr); |
44 | | - } |
45 | | - |
46 | | - std::vector<Topo::Block*> blocks = getFilteredEntities<Topo::Block>(); |
47 | | - if (!blocks.empty()){ |
48 | | - Utils::SerializedRepresentation sr ("Blocs topologiques", |
49 | | - TkUtil::NumericConversions::toStr(blocks.size())); |
50 | | - for (Topo::Block* b : blocks) |
51 | | - sr.addProperty(Utils::SerializedRepresentation::Property(b->getName ( ), *b)); |
52 | | - description->addPropertiesSet(sr); |
53 | | - } |
54 | | - |
55 | | - // recherche du Mesh::Volume associé (suivant le nom) |
56 | | - Mesh::Volume* mvol = getContext().getMeshManager().getVolume(getName(), false); |
57 | | - if (mvol){ |
58 | | - Utils::SerializedRepresentation sr ("Volume maillage", std::string("1")); |
59 | | - sr.addProperty(Utils::SerializedRepresentation::Property (mvol->getName(), *mvol)); |
60 | | - description->addPropertiesSet(sr); |
61 | | - } else { |
62 | | - description->addProperty(Utils::SerializedRepresentation::Property( |
63 | | - "Volume maillage", std::string("Aucun"))); |
64 | | - } |
65 | | - |
66 | | - std::vector<CoordinateSystem::SysCoord*> scs = getFilteredEntities<CoordinateSystem::SysCoord>(); |
67 | | - if (!scs.empty()){ |
68 | | - Utils::SerializedRepresentation sr ("Repères", |
69 | | - TkUtil::NumericConversions::toStr(scs.size())); |
70 | | - for (CoordinateSystem::SysCoord* sc : scs) |
71 | | - sr.addProperty(Utils::SerializedRepresentation::Property(sc->getName(), *sc)); |
72 | | - description->addPropertiesSet(sr); |
73 | | - } |
74 | | - |
75 | | - return description.release ( ); |
76 | | -} |
77 | | -/*----------------------------------------------------------------------------*/ |
78 | | -} // end namespace Group |
79 | | -/*----------------------------------------------------------------------------*/ |
80 | | -} // end namespace Mgx3D |
| 22 | +} // end namespace Mgx3D::Group |
81 | 23 | /*----------------------------------------------------------------------------*/ |
0 commit comments