mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
0024904: Visualization - Integration of VIS component:
Added new toolkit TKIVtk: - TKIVtk toolkit includes IVtkVTK, IVtkTools, IVtkOCC, IVtk packages. - TKIVtk provides OCC interface for VTK library functionality: it allows to use VTK window and event managment for OCC objects (shapes) Porting on VTK 6: - shape source inherits vtkPolyDataAlgorithm now (vtkPolyDataSource was removed form VTK as deprecated functionality). - added factory auto-initialization in IVtkVTK_View - remove using of deprecated methods of pipeline mechanism. Get rid from warning in SelectMgr_SelectableObject. Removed firendship from SelectMgr_SelectableObject. Corrected projector parameters for selection algorithm. Removed unneeded picking algorithm modification.
This commit is contained in:
85
src/IVtkTools/IVtkTools_ShapeObject.hxx
Normal file
85
src/IVtkTools/IVtkTools_ShapeObject.hxx
Normal file
@@ -0,0 +1,85 @@
|
||||
// Created on: 2011-10-27
|
||||
// Created by: Roman KOZLOV
|
||||
// Copyright (c) 2011-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef __IVTKTOOLS_SHAPEOBJECT_H__
|
||||
#define __IVTKTOOLS_SHAPEOBJECT_H__
|
||||
|
||||
#include <IVtkTools.hxx>
|
||||
#include <IVtkOCC_Shape.hxx>
|
||||
#include <vtkDataObject.h>
|
||||
#include <vtkSetGet.h>
|
||||
#include <vtkSmartPointer.h>
|
||||
|
||||
class vtkActor;
|
||||
class vtkDataSet;
|
||||
class vtkInformationObjectBaseKey;
|
||||
class IVtkTools_ShapeDataSource;
|
||||
|
||||
//! @class IVtkTools_ShapeObject
|
||||
//! @brief VTK holder class for OCC shapes to pass them through pipelines.
|
||||
//!
|
||||
//! It is descendent of vtkObject (data). Logically it is a one of milestones of VTK pipeline.
|
||||
//! It stores data of OCC shape (the OccShape instance) in vtkInformation object of vtkDataObject.
|
||||
//! Then pass it to the actors through pipelines,
|
||||
//! so selection logic can access OccShape easily given the actor instance.
|
||||
class IVtkTools_EXPORT IVtkTools_ShapeObject : public vtkDataObject
|
||||
{
|
||||
public:
|
||||
vtkTypeMacro (IVtkTools_ShapeObject, vtkObject);
|
||||
|
||||
static IVtkTools_ShapeObject* New();
|
||||
|
||||
//! Get OCC shape source from VTK data from actor's information object by key.
|
||||
static IVtkTools_ShapeDataSource* GetShapeSource (vtkActor* theActor);
|
||||
|
||||
//! Get OCC shape from VTK data from actor's information object by key.
|
||||
static IVtkOCC_Shape::Handle GetOccShape (vtkActor* theActor);
|
||||
|
||||
//! Static method to set OCC shape source to VTK dataset in information object
|
||||
//! with key.
|
||||
static void SetShapeSource (IVtkTools_ShapeDataSource* theDataSource, vtkDataSet* theData);
|
||||
|
||||
//! Static method to set OCC shape source to VTK actor in information object
|
||||
//! with key.
|
||||
static void SetShapeSource (IVtkTools_ShapeDataSource* theDataSource, vtkActor* theActor);
|
||||
|
||||
typedef vtkInformationObjectBaseKey* KeyPtr;
|
||||
|
||||
//! Static method used by shape selection logic in order to establish
|
||||
//! a connection from vtkActor to OccShape instance.
|
||||
//! @return vtkInformationKey for retrieving OccShape instance from the actor
|
||||
static KeyPtr getKey();
|
||||
|
||||
//! OCC shape source setter.
|
||||
void SetShapeSource (IVtkTools_ShapeDataSource* theDataSource);
|
||||
|
||||
//! OCC shape source getter.
|
||||
IVtkTools_ShapeDataSource* GetShapeSource () const;
|
||||
|
||||
protected:
|
||||
IVtkTools_ShapeObject();
|
||||
~IVtkTools_ShapeObject();
|
||||
|
||||
private: // not copyable
|
||||
IVtkTools_ShapeObject (const IVtkTools_ShapeObject&);
|
||||
IVtkTools_ShapeObject& operator= (const IVtkTools_ShapeObject&);
|
||||
|
||||
private: // OCC
|
||||
vtkSmartPointer<IVtkTools_ShapeDataSource> myShapeSource;
|
||||
|
||||
static KeyPtr myKey;
|
||||
};
|
||||
|
||||
#endif // __IVTKTOOLS_SHAPEOBJECT_H__
|
||||
Reference in New Issue
Block a user