Commit b73e9c21 authored by pieper's avatar pieper
Browse files

COMP: initial checkin of some logic code

git-svn-id: http://svn.slicer.org/Slicer4/trunk@3 3bd1e089-480b-0410-8dfb-8563597acbee
parent c88d4001
/*=auto=========================================================================
Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
See Doc/copyright/copyright.txt
or http://www.slicer.org/copyright/copyright.txt for details.
Program: 3D Slicer
Module: $RCSfile: vtkSlicerLogic.cxx,v $
Date: $Date: 2006/01/06 17:56:48 $
Version: $Revision: 1.58 $
=========================================================================auto=*/
#include "vtkObjectFactory.h"
#include "vtkSlicerLogic.h"
vtkCxxRevisionMacro(vtkSlicerLogic, "$Revision: 1.9.12.1 $");
vtkStandardNewMacro(vtkSlicerLogic);
//----- This hack needed to compile using gcc3 on OSX until new stdc++.dylib
#ifdef __APPLE_CC__
extern "C"
{
void oft_initSlicerBase()
{
extern void _ZNSt8ios_base4InitC4Ev();
_ZNSt8ios_base4InitC4Ev();
}
}
#endif
//----------------------------------------------------------------------------
vtkSlicerLogic::vtkSlicerLogic()
{
}
//----------------------------------------------------------------------------
vtkSlicerLogic::~vtkSlicerLogic()
{
}
//----------------------------------------------------------------------------
void vtkSlicerLogic::PrintSelf(ostream& os, vtkIndent indent)
{
this->vtkObject::PrintSelf(os, indent);
os << indent << "SlicerLogic: " << this->GetClassName() << "\n";
}
/*=auto=========================================================================
Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
See Doc/copyright/copyright.txt
or http://www.slicer.org/copyright/copyright.txt for details.
Program: 3D Slicer
Module: $RCSfile: vtkSlicerApplicationLogic.h,v $
Date: $Date: 2006/01/08 04:48:05 $
Version: $Revision: 1.45 $
=========================================================================auto=*/
// .NAME vtkSlicerApplicationLogic - the main logic to manage the application
// .SECTION Description
// The Main entry point for the slicer3 application.
// -- manages the connection to the mrml scene
// -- manages the creation of Views and Slices (logic only)
// -- serves as central point for dispatching events
// There is a corresponding vtkSlicerApplicationGUI class that provides
// a user interface to this class by observing this class.
//
#ifndef __vtkSlicerApplicationLogic_h
#define __vtkSlicerApplicationLogic_h
#include "vtkSlicerLogic.h"
#include "vtkMrml.h"
#include "vtkMrmlScene.h"
class VTK_SLICER_LOGIC_EXPORT vtkSlicerApplicationLogic : public vtkSlicerLogic
{
public:
// The Usual vtk class functions
static vtkSlicerApplicationLogic *New();
vtkTypeMacro(vtkSlicerApplicationLogic,vtkObject);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Get the current Mrml Scene object
vtkGetObjectMacro(MrmlScene,vtkMrmlScene);
// Description:
// Connect to the given URL. Disconnect any currently active
// connection to switch to a new connection. A NULL pointer means
// to disconnect current and not have a current connection
// (creates a blank scene for manipulation).
// Return code tells if connection was completed successfully.
int Connect (const char *URL);
// Description:
// Commit your current scene modifications to the connected URL
// Return code tells result of commit.
int Commit ();
// Description:
// Commit your current scene modifications to specified URL
// Return code tells result of commit.
int Commit (const char *URL);
// Description:
// Additional methods here to manipulate the application:
// Info needed:
// SlicerVersion
// others?
//
// Views, Slices, Modules
// -- these are the fundamental slicer elements
// -- these are dynamic (discovered, create, deleted at run time)
//
///// Views
// Description:
// Views are the 3D viewports into the mrml scene
// SlicerLogic maintains the list of currently active views
vtkSetObjectMacro (Views,vtkSlicerViewCollection);
vtkGetObjectMacro (Views,vtkSlicerViewCollection);
// Description:
// Views are the 3D viewports into the mrml scene
// SlicerLogic maintains the list of currently active views
vtkSetObjectMacro (Views,vtkSlicerViewCollection);
vtkGetObjectMacro (Views,vtkSlicerViewCollection);
// Description:
// the ActiveView is the default destination of UI events
vtkSetObjectMacro (ActiveView,vtkSlicerView);
vtkGetObjectMacro (ActiveView,vtkSlicerView);
///// Slices
// Description:
// Slices are the 2D viewports that show composited layers
// of volume data from a particular slice definition.
vtkSetObjectMacro (Slices,vtkSlicerSliceCollection);
vtkGetObjectMacro (Slices,vtkSlicerSliceCollection);
// Description:
// the ActiveSlice is the default destination of UI events
vtkSetObjectMacro (ActiveSlice,vtkSlicerSlice);
vtkGetObjectMacro (ActiveSlice,vtkSlicerSlice);
///// Modules
// Description:
// Modules are additional pieces of Slicer functionality
// that are loaded and managed at run time
vtkSetObjectMacro (Modules,vtkSlicerModuleCollection);
vtkGetObjectMacro (Modules,vtkSlicerModuleCollection);
// Description:
// the ActiveModule is the default destination of UI events
vtkSetObjectMacro (ActiveModule,vtkSlicerModule);
vtkGetObjectMacro (ActiveModule,vtkSlicerModule);
//
// Transient Application State
// -- these are elements that are inherently part of the
// currently running application and are not stored in
// the mrml tree
// -- any state that is expected to be saved and restored
// must be either part of the mrml scene or
// stored in the registry part of the GUI layer
//
protected:
vtkSlicerApplicationLogic();
~vtkSlicerApplicationLogic();
vtkSlicerApplicationLogic(const vtkSlicerApplicationLogic&) {};
void operator=(const vtkSlicerApplicationLogic&) {};
private:
vtkMrmlScene *MrmlScene;
vtkSlicerViewCollection *Views;
vtkSlicerSliceCollection *Slices;
vtkSlicerModuleCollection *Modules;
vtkSlicerView *ActiveView;
vtkSlicerSlice *ActiveSlice;
vtkSlicerModule *ActiveModule;
// Transient Application State
};
#endif
/*=auto=========================================================================
Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
See Doc/copyright/copyright.txt
or http://www.slicer.org/copyright/copyright.txt for details.
Program: 3D Slicer
Module: $RCSfile: vtkSlicerLogic.cxx,v $
Date: $Date: 2006/01/06 17:56:48 $
Version: $Revision: 1.58 $
=========================================================================auto=*/
#include "vtkObjectFactory.h"
#include "vtkSlicerLogic.h"
vtkCxxRevisionMacro(vtkSlicerLogic, "$Revision: 1.9.12.1 $");
vtkStandardNewMacro(vtkSlicerLogic);
//----- This hack needed to compile using gcc3 on OSX until new stdc++.dylib
#ifdef __APPLE_CC__
extern "C"
{
void oft_initSlicerBase()
{
extern void _ZNSt8ios_base4InitC4Ev();
_ZNSt8ios_base4InitC4Ev();
}
}
#endif
//----------------------------------------------------------------------------
vtkSlicerLogic::vtkSlicerLogic()
{
}
//----------------------------------------------------------------------------
vtkSlicerLogic::~vtkSlicerLogic()
{
}
//----------------------------------------------------------------------------
void vtkSlicerLogic::PrintSelf(ostream& os, vtkIndent indent)
{
this->vtkObject::PrintSelf(os, indent);
os << indent << "SlicerLogic: " << this->GetClassName() << "\n";
}
/*=auto=========================================================================
Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
See Doc/copyright/copyright.txt
or http://www.slicer.org/copyright/copyright.txt for details.
Program: 3D Slicer
Module: $RCSfile: vtkSlicerLogic.h,v $
Date: $Date: 2006/01/08 04:48:05 $
Version: $Revision: 1.45 $
=========================================================================auto=*/
// .NAME vtkSlicerLogic - superclass for slicer logic classes
// .SECTION Description
// Superclass for all slicer logic classes (application, views, slices).
// There must be a corresponding vtkSlicerGUI subclass corresponding
// to each logic class that handles all GUI interaction (no GUI code
// goes in the logic class).
#ifndef __vtkSlicerLogic_h
#define __vtkSlicerLogic_h
#include <stdlib.h>
#include "vtkSlicer.h"
#ifndef vtkFloatingPointType
#define vtkFloatingPointType float
#endif
class VTK_SLICER_LOGIC_EXPORT vtkSlicerLogic : public vtkObject
{
public:
// The Usual vtk class functions
static vtkSlicerLogic *New();
vtkTypeMacro(vtkSlicerLogic,vtkObject);
void PrintSelf(ostream& os, vtkIndent indent);
// Additional functionality:
// -- an undo stack (also need helper classes)
// -- a tracing/macro infrastructure
protected:
vtkSlicerLogic();
~vtkSlicerLogic();
vtkSlicerLogic(const vtkSlicerLogic&) {};
void operator=(const vtkSlicerLogic&) {};
};
#endif
/*=auto=========================================================================
Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
See Doc/copyright/copyright.txt
or http://www.slicer.org/copyright/copyright.txt for details.
Program: 3D Slicer
Module: $RCSfile: vtkSlicerLogic.cxx,v $
Date: $Date: 2006/01/06 17:56:48 $
Version: $Revision: 1.58 $
=========================================================================auto=*/
#include "vtkObjectFactory.h"
#include "vtkSlicerLogic.h"
vtkCxxRevisionMacro(vtkSlicerLogic, "$Revision: 1.9.12.1 $");
vtkStandardNewMacro(vtkSlicerLogic);
//----- This hack needed to compile using gcc3 on OSX until new stdc++.dylib
#ifdef __APPLE_CC__
extern "C"
{
void oft_initSlicerBase()
{
extern void _ZNSt8ios_base4InitC4Ev();
_ZNSt8ios_base4InitC4Ev();
}
}
#endif
//----------------------------------------------------------------------------
vtkSlicerLogic::vtkSlicerLogic()
{
}
//----------------------------------------------------------------------------
vtkSlicerLogic::~vtkSlicerLogic()
{
}
//----------------------------------------------------------------------------
void vtkSlicerLogic::PrintSelf(ostream& os, vtkIndent indent)
{
this->vtkObject::PrintSelf(os, indent);
os << indent << "SlicerLogic: " << this->GetClassName() << "\n";
}
/*=auto=========================================================================
Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
See Doc/copyright/copyright.txt
or http://www.slicer.org/copyright/copyright.txt for details.
Program: 3D Slicer
Module: $RCSfile: vtkSlicerSliceLogic.h,v $
Date: $Date: 2006/01/08 04:48:05 $
Version: $Revision: 1.45 $
=========================================================================auto=*/
// .NAME vtkSlicerSliceLogic - slicer logic class for slice manipulation
// .SECTION Description
// This class manages the logic associated with display of slice windows
// (but not the GUI). Features of the class include:
// -- a back-to-front list of MrmlVolumes to be displayed
// -- a compositing mode for each volume layer (opacity, outline, glyph, checkerboard, etc)
// -- a current slice view specification
// ---- slab thickness
// ---- slice center
// ---- pan/zoom settings
// ---- slice space (pixel, RAS)
// ---- view coordinate space (RAS, Camera Relative, other)
//
// This class manages internal vtk pipelines that create an output vtkImageData
// which can be used by the vtkSlicerSliceGUI class to display the resulting
// composite image or it can be used as a texture map in a vtkSlicerView.
// This class can also be used for resampling volumes for further computation.
#ifndef __vtkSlicerSliceLogic_h
#define __vtkSlicerSliceLogic_h
#include <stdlib.h>
#include "vtkSlicerLogic.h"
#include "vtkMrml.h"
#include "vtkMrmlVolume.h"
class VTK_SLICER_LOGIC_EXPORT vtkSlicerSliceLogic : public vtkSlicerLogic
{
public:
// The Usual vtk class functions
static vtkSlicerSliceLogic *New();
vtkTypeMacro(vtkSlicerSliceLogic,vtkObject);
void PrintSelf(ostream& os, vtkIndent indent);
protected:
vtkSlicerSliceLogic();
~vtkSlicerSliceLogic();
vtkSlicerSliceLogic(const vtkSlicerSliceLogic&) {};
void operator=(const vtkSlicerSliceLogic&) {};
// Description:
//
};
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment