119 lines
4.4 KiB
C++
119 lines
4.4 KiB
C++
//
|
|
// ********************************************************************
|
|
// * DISCLAIMER *
|
|
// * *
|
|
// * The following disclaimer summarizes all the specific disclaimers *
|
|
// * of contributors to this software. The specific disclaimers,which *
|
|
// * govern, are listed with their locations in: *
|
|
// * http://cern.ch/geant4/license *
|
|
// * *
|
|
// * Neither the authors of this software system, nor their employing *
|
|
// * institutes,nor the agencies providing financial support for this *
|
|
// * work make any representation or warranty, express or implied, *
|
|
// * regarding this software system or assume any liability for its *
|
|
// * use. *
|
|
// * *
|
|
// * This code implementation is the intellectual property of the *
|
|
// * GEANT4 collaboration. *
|
|
// * By copying, distributing or modifying the Program (or any work *
|
|
// * based on the Program) you indicate your acceptance of this *
|
|
// * statement, and all its terms. *
|
|
// ********************************************************************
|
|
//
|
|
//
|
|
// $Id: G4VModel.hh,v 1.13 2001/08/24 20:36:26 johna Exp $
|
|
// GEANT4 tag $Name: geant4-05-00 $
|
|
//
|
|
//
|
|
// John Allison 31st December 1997.
|
|
//
|
|
// Class Description:
|
|
//
|
|
// G4VModel is a base class for visualization models. A model is a
|
|
// graphics-system-indepedent description of a Geant4 component.
|
|
// The key fuctionality of a model is to know how to describe itself
|
|
// to a scene handler. A scene is a collection of models.
|
|
// A special case is made for G4PhysicalVolumeModel - a non-null pointer
|
|
// is to be returned by G4PhysicalVolumeModel::GetG4PhysicalVolumeModel().
|
|
|
|
#ifndef G4VMODEL_HH
|
|
#define G4VMODEL_HH
|
|
|
|
#include "globals.hh"
|
|
#include "G4VisExtent.hh"
|
|
#include "G4Transform3D.hh"
|
|
|
|
class G4VGraphicsScene;
|
|
class G4ModelingParameters;
|
|
|
|
class G4PhysicalVolumeModel; // Special case - see above.
|
|
|
|
class G4VModel {
|
|
|
|
public: // With description
|
|
|
|
friend G4std::ostream& operator << (G4std::ostream& os, const G4VModel&);
|
|
|
|
G4VModel
|
|
(const G4Transform3D& modelTransformation = G4Transform3D::Identity,
|
|
const G4ModelingParameters* = 0);
|
|
|
|
virtual ~G4VModel ();
|
|
|
|
virtual void DescribeYourselfTo (G4VGraphicsScene&) = 0;
|
|
// The main task of a model is to describe itself to the graphics scene.
|
|
|
|
const G4ModelingParameters* GetModelingParameters () const;
|
|
|
|
virtual G4String GetCurrentDescription () const;
|
|
// A description which depends on the current state of the model.
|
|
|
|
virtual G4String GetCurrentTag () const;
|
|
// A tag which depends on the current state of the model.
|
|
|
|
const G4VisExtent& GetExtent () const;
|
|
// Extent of visible objects in local coordinate system.
|
|
// Define protected data member in derived class constructor.
|
|
|
|
const G4String& GetGlobalDescription () const;
|
|
// A description which does not change and lasts the life of the model.
|
|
// Define protected data member in derived class constructor.
|
|
|
|
const G4String& GetGlobalTag () const;
|
|
// A tag which does not change and lasts the life of the model.
|
|
// Define protected data member in derived class constructor.
|
|
|
|
const G4Transform3D& GetTransformation () const;
|
|
// Model transformation, i.e., position and orientation of model in world.
|
|
|
|
virtual const G4PhysicalVolumeModel* GetG4PhysicalVolumeModel () const;
|
|
virtual G4PhysicalVolumeModel* GetG4PhysicalVolumeModel ();
|
|
// Returns 0 unless implemented by derived class.
|
|
|
|
void SetModelingParameters (const G4ModelingParameters*);
|
|
|
|
void SetExtent (const G4VisExtent&);
|
|
|
|
virtual G4bool Validate (G4bool warn = true);
|
|
// Validate, but allow internal changes (hence non-const function).
|
|
|
|
protected:
|
|
|
|
G4String fGlobalTag;
|
|
G4String fGlobalDescription;
|
|
G4VisExtent fExtent;
|
|
G4Transform3D fTransform;
|
|
const G4ModelingParameters* fpMP;
|
|
|
|
private:
|
|
|
|
// Private copy constructor and assigment operator - copying and
|
|
// assignment not allowed. Keeps CodeWizard happy.
|
|
G4VModel (const G4VModel&);
|
|
G4VModel& operator = (const G4VModel&);
|
|
};
|
|
|
|
#include "G4VModel.icc"
|
|
|
|
#endif
|