X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FInitializationPlugin%2FInitializationPlugin_Plugin.cpp;h=c71d8f767d143d3cb01995937782b7718d769093;hb=d570a46bdbeb5b2279f04a4746de7da413f0b0a6;hp=ee76b04d279dac93553611358e09753611dc9bcb;hpb=423c10234142d14d0d5de89383f2f96a4ec5930f;p=modules%2Fshaper.git diff --git a/src/InitializationPlugin/InitializationPlugin_Plugin.cpp b/src/InitializationPlugin/InitializationPlugin_Plugin.cpp index ee76b04d2..c71d8f767 100644 --- a/src/InitializationPlugin/InitializationPlugin_Plugin.cpp +++ b/src/InitializationPlugin/InitializationPlugin_Plugin.cpp @@ -1,7 +1,26 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D +// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// +// 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, 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 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or +// email : webmaster.salome@opencascade.com +// #include +#include #include #include #include @@ -11,6 +30,8 @@ #include #include +#include + #include #include @@ -25,6 +46,9 @@ InitializationPlugin_Plugin::InitializationPlugin_Plugin() Events_Loop* aLoop = Events_Loop::loop(); const Events_ID kDocCreatedEvent = ModelAPI_DocumentCreatedMessage::eventId(); aLoop->registerListener(this, kDocCreatedEvent, NULL, true); + + myEvalListener = + std::shared_ptr(new InitializationPlugin_EvalListener()); } void InitializationPlugin_Plugin::processEvent(const std::shared_ptr& theMessage) @@ -115,10 +139,10 @@ FeaturePtr InitializationPlugin_Plugin::createPoint(DocumentPtr theDoc, const st double theX, double theY, double theZ) { std::shared_ptr aPoint = theDoc->addFeature("Point"); - //aPoint->string("creation_method")->setValue("by_xyz"); - aPoint->real("x")->setValue(theX); - aPoint->real("y")->setValue(theY); - aPoint->real("z")->setValue(theZ); + AttributePointPtr aPointAttr = std::dynamic_pointer_cast + (aPoint->data()->attribute("point3d")); + aPointAttr->setValue(theX, theY, theZ); + aPoint->string("creation_method")->setValue("by_xyz"); aPoint->data()->setName(theName); // don't show automatically created feature in the features history aPoint->setInHistory(aPoint, false);