1 // Copyright (C) 2023 CEA, EDF
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #include "SALOME_Prs.h"
26 class pqPipelineSource;
27 class pqDataRepresentation;
29 class SPV3D_EXPORTSPV3DData
32 SPV3D_EXPORTSPV3DData() = default;
33 SPV3D_EXPORTSPV3DData *deepCopy() { return new SPV3D_EXPORTSPV3DData(*this); }
34 void SetSourceProducer(pqPipelineSource *sourceProducer) const { _sourceProducer = sourceProducer; }
35 pqPipelineSource *GetSourceProducer() const { return _sourceProducer; }
37 void SetRepresentation(pqDataRepresentation *repr) const { _repr = repr; }
38 pqDataRepresentation *GetRepresentation() const { return _repr; }
40 bool IsNull() const { return !_sourceProducer && !_repr; }
42 bool IsVisible() const;
45 SPV3D_EXPORTSPV3DData(const SPV3D_EXPORTSPV3DData& other) = default;
47 mutable pqPipelineSource *_sourceProducer = nullptr;
48 mutable pqDataRepresentation *_repr = nullptr;
51 class SPV3D_ViewWindow;
53 class SPV3D_EXPORT SPV3D_Prs : public SALOME_PV3DPrs
56 explicit SPV3D_Prs( const char* entry, SPV3D_ViewWindow *view);
59 void SetName(const std::string& name) { _name = name; }
61 SPV3D_Prs *deepCopy() const;
63 void FillUsingActor(vtkActor *actor) const;
65 void DisplayIn( SALOME_View* v ) const override;
67 void CopyInfo(SPV3D_EXPORTSPV3DData *info) const;
69 void SetPVRenderInfo(SPV3D_EXPORTSPV3DData *pvRendInfo) { _pvRendInfo = pvRendInfo; }
71 void SetSourceProducer(pqPipelineSource *sourceProducer) const { if(_pvRendInfo) _pvRendInfo->SetSourceProducer(sourceProducer); }
72 pqPipelineSource *GetSourceProducer() const { if(_pvRendInfo) return _pvRendInfo->GetSourceProducer(); return nullptr; }
74 void SetRepresentation(pqDataRepresentation *repr) const { if(_pvRendInfo) _pvRendInfo->SetRepresentation(repr); }
75 pqDataRepresentation *GetRepresentation() const { if(_pvRendInfo) return _pvRendInfo->GetRepresentation(); return nullptr; }
77 bool IsNull() const override;
81 SPV3D_Prs(const SPV3D_Prs& other) = default;
84 void hide() const { if(_pvRendInfo) return _pvRendInfo->Hide(); }
85 bool isVisible() const { if(_pvRendInfo) return _pvRendInfo->IsVisible(); return false; }
89 SPV3D_EXPORTSPV3DData *_pvRendInfo = nullptr;
90 SPV3D_ViewWindow *_view = nullptr;
91 //! Name attached to the displayable object in the study