Salome HOME
Affichage du diagnostic
[modules/smesh.git] / src / SMDS / SMDS_SpacePosition.cxx
index 422de6a3fdf07b9ef72c65874580e99c4b150146..22c949de8ef82ef48d6dba461642120a6e01307e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // This library 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.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-//  SMESH SMDS : implementaion of Salome mesh data structure
+//  SMESH SMDS : implementation of Salome mesh data structure
 //  File   : SMDS_SpacePosition.cxx
 //  Author : Jean-Michel BOULCOURT
 //  Module : SMESH
 //
 
 #include "SMDS_SpacePosition.hxx"
+#include "SMDS_VertexPosition.hxx"
 
-SMDS_SpacePosition* SMDS_SpacePosition::_originPosition = new SMDS_SpacePosition();
+SMDS_SpacePosition* SMDS_SpacePosition::__originPosition = nullptr;
 
-SMDS_SpacePosition::SMDS_SpacePosition(double x, double y, double z)
+SMDS_PositionPtr SMDS_SpacePosition::originSpacePosition()
 {
+  return SMDS_PositionPtr( _originPosition(), /*isOwner=*/false );
 }
 
-SMDS_TypeOfPosition SMDS_SpacePosition::GetTypeOfPosition() const
+SMDS_PositionPtr SMDS_VertexPosition::StaticPosition()
 {
-  return SMDS_TOP_3DSPACE;
+  static SMDS_Position* _vertexPosition = new SMDS_VertexPosition;
+  return SMDS_PositionPtr( _vertexPosition, /*isOwner=*/false );
 }
 
-SMDS_PositionPtr SMDS_SpacePosition::originSpacePosition()
+SMDS_SpacePosition *SMDS_SpacePosition::_originPosition()
 {
-  return _originPosition;
-}
+  if(!__originPosition)
+    __originPosition = new SMDS_SpacePosition;
+  return __originPosition;
+}
\ No newline at end of file