Re: [Paraview] pqViewManager in Clone2

2010-03-22 Thread Adebayo Olowoyeye
I'm using Clone2 as a base for the application and it has:

  ...
  ...
  PVMAIN_WINDOW_INCLUDE myMainWindow.h
  GUI_CONFIGURATION_XMLS
${CMAKE_CURRENT_SOURCE_DIR}/ParaViewSources.xml
${CMAKE_CURRENT_SOURCE_DIR}/ParaViewFilters.xml
${CMAKE_CURRENT_SOURCE_DIR}/ParaViewReaders.xml
${CMAKE_CURRENT_SOURCE_DIR}/ParaViewWriters.xml
  SOURCES ${ParaView_SOURCE_FILES}
)

in the CMakeLists.txt file.  I want to use the open file routine used to
open any legal file type, but in code.
Thanks


On Mon, Mar 22, 2010 at 9:36 AM, Utkarsh Ayachit 
utkarsh.ayac...@kitware.com wrote:

 That's because you haven't registered any readers with the reader
 factory.

 Look at:

 http://www.paraview.org/Wiki/Writing_Custom_Applications#ParaViewReaders:_Reader_Factory_Configuration

 You need to specify an XML with the names of the readers that your
 applications wants to expose in the build_paraview_client() function
 call.

 Utkarsh



 On Sat, Mar 20, 2010 at 2:56 PM, Adebayo Olowoyeye
 aolow...@umail.iu.edu wrote:
  Thanks, That worked well.  I am currently trying to load a .vtk file with
  the following:
 
  QStringList fileList;
  QString reprType;
  reprType = VOLUME;
 
  fileList.push_back(../
  ParaViewData/Data/blow.vtk);
  pqPipelineSource *readerSource =
 pqLoadDataReaction::loadData(fileList);
 
  pqDataRepresentation * repr =
  objBuilder-createDataRepresentation(readerSource-getOutputPort(0),
  reprType);
 
  I get a popup window with a window label Open Data With ... and message
 A
  reader for '../ParaViewData/Data/blow.vtk' could not be found.  Please
  choose one:
 
  There are no reader options available.
 
  The program will need to load multiple file types so I want to use a
 module
  that can load any valid file type.  Are the reader options loaded
  automatically from ParaViewReader.xml?  Is pqLoadDataReaction the correct
  class for loading files?
  Thanks!
 
  On Thu, Mar 18, 2010 at 11:22 AM, Utkarsh Ayachit
  utkarsh.ayac...@kitware.com wrote:
 
  Hello,
 
  If you are creating a custom application which always has 4 render
  windows, then I'd suggest not even using the pqViewManager.
  Simply create the 4 views yourself and pack them into a QWidget using
  a QGridLayout. For example, the following code can be used after a
  server connection has been made to set up the 4 views.
 
  QWidget* centralWidget = new QWidget();
  mainWindow-setCentralWidget(centralWidget);
  QGridLayout* gl  = new QGridLayout(centralWidget);
 
  for (int xx=0; xx  2; xx++)
  {
   for (int yy=0; yy  2; yy++)
 {
 pqRenderView* view = qobject_castpqRenderView*(
   ob-createView(pqRenderView::renderViewType(), server));
 gl-addWidget(view-getWidget(), yy, xx);
 }
  }
 
  Utkarsh
 
  On Thu, Mar 18, 2010 at 10:22 AM, Adebayo Olowoyeye
  aolow...@umail.iu.edu wrote:
   Hi,
  
   I am attempting to use the Clone2 CustomApplication example to write a
   custom application in C++.  The wiki documentation on Custom
   Applications
   suggest using pqViewManager to control the view of the application.
  
   I want to split the frame into four different windows, each with its
 own
   view.  I am assuming the program starts with one frame and one view.
 Is
   this assumption correct?
  
   I reference the pqViewManager with the following code:
  this-Internals-MultiViewManager
  
   the active view (I'm guessing the only view at this point is):
  pqView* view =
   this-Internals-MultiViewManager-getActiveView();
  
   This problem is there are no public methods to split the frame in
   pqViewManager.  It is possible to get the pqMultiViewFrame:
   pqMultiViewFrame * multiViewFrame =
   this-Internals-MultiViewManager-getFrame(view);
  
   I've tested this by:
   multiViewFrame-setTitle(HELLO WORLD!);
  
   and it works, but I've tried multiple tries to get the frame to split
   without success.  Any insight will help.
   Thanks!
  
   ___
   Powered by www.kitware.com
  
   Visit other Kitware open-source projects at
   http://www.kitware.com/opensource/opensource.html
  
   Please keep messages on-topic and check the ParaView Wiki at:
   http://paraview.org/Wiki/ParaView
  
   Follow this link to subscribe/unsubscribe:
   http://www.paraview.org/mailman/listinfo/paraview
  
  
 
 
  ___
  Powered by www.kitware.com
 
  Visit other Kitware open-source projects at
  http://www.kitware.com/opensource/opensource.html
 
  Please keep messages on-topic and check the ParaView Wiki at:
  http://paraview.org/Wiki/ParaView
 
  Follow this link to subscribe/unsubscribe:
  http://www.paraview.org/mailman/listinfo/paraview
 
 

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http

Re: [Paraview] pqViewManager in Clone2

2010-03-20 Thread Adebayo Olowoyeye
Thanks, That worked well.  I am currently trying to load a .vtk file with
the following:

QStringList fileList;
QString reprType;
reprType = VOLUME;

fileList.push_back(../
ParaViewData/Data/blow.vtk);
pqPipelineSource *readerSource = pqLoadDataReaction::loadData(fileList);

pqDataRepresentation * repr =
objBuilder-createDataRepresentation(readerSource-getOutputPort(0),
reprType);

I get a popup window with a window label Open Data With ... and message A
reader for '../ParaViewData/Data/blow.vtk' could not be found.  Please
choose one:

There are no reader options available.

The program will need to load multiple file types so I want to use a module
that can load any valid file type.  Are the reader options loaded
automatically from ParaViewReader.xml?  Is pqLoadDataReaction the correct
class for loading files?
Thanks!


On Thu, Mar 18, 2010 at 11:22 AM, Utkarsh Ayachit 
utkarsh.ayac...@kitware.com wrote:

 Hello,

 If you are creating a custom application which always has 4 render
 windows, then I'd suggest not even using the pqViewManager.
 Simply create the 4 views yourself and pack them into a QWidget using
 a QGridLayout. For example, the following code can be used after a
 server connection has been made to set up the 4 views.

 QWidget* centralWidget = new QWidget();
 mainWindow-setCentralWidget(centralWidget);
 QGridLayout* gl  = new QGridLayout(centralWidget);

 for (int xx=0; xx  2; xx++)
 {
  for (int yy=0; yy  2; yy++)
{
pqRenderView* view = qobject_castpqRenderView*(
  ob-createView(pqRenderView::renderViewType(), server));
gl-addWidget(view-getWidget(), yy, xx);
}
 }

 Utkarsh

 On Thu, Mar 18, 2010 at 10:22 AM, Adebayo Olowoyeye
 aolow...@umail.iu.edu wrote:
  Hi,
 
  I am attempting to use the Clone2 CustomApplication example to write a
  custom application in C++.  The wiki documentation on Custom Applications
  suggest using pqViewManager to control the view of the application.
 
  I want to split the frame into four different windows, each with its own
  view.  I am assuming the program starts with one frame and one view.  Is
  this assumption correct?
 
  I reference the pqViewManager with the following code:
 this-Internals-MultiViewManager
 
  the active view (I'm guessing the only view at this point is):
 pqView* view = this-Internals-MultiViewManager-getActiveView();
 
  This problem is there are no public methods to split the frame in
  pqViewManager.  It is possible to get the pqMultiViewFrame:
  pqMultiViewFrame * multiViewFrame =
  this-Internals-MultiViewManager-getFrame(view);
 
  I've tested this by:
  multiViewFrame-setTitle(HELLO WORLD!);
 
  and it works, but I've tried multiple tries to get the frame to split
  without success.  Any insight will help.
  Thanks!
 
  ___
  Powered by www.kitware.com
 
  Visit other Kitware open-source projects at
  http://www.kitware.com/opensource/opensource.html
 
  Please keep messages on-topic and check the ParaView Wiki at:
  http://paraview.org/Wiki/ParaView
 
  Follow this link to subscribe/unsubscribe:
  http://www.paraview.org/mailman/listinfo/paraview
 
 

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview


[Paraview] pqViewManager in Clone2

2010-03-18 Thread Adebayo Olowoyeye
Hi,

I am attempting to use the Clone2 CustomApplication example to write a
custom application in C++.  The wiki documentation on Custom Applications
suggest using pqViewManager to control the view of the application.

I want to split the frame into four different windows, each with its own
view.  I am assuming the program starts with one frame and one view.  Is
this assumption correct?

I reference the pqViewManager with the following code:
   this-Internals-MultiViewManager

the active view (I'm guessing the only view at this point is):
   pqView* view = this-Internals-MultiViewManager-getActiveView();

This problem is there are no public methods to split the frame in
pqViewManager.  It is possible to get the pqMultiViewFrame:
pqMultiViewFrame * multiViewFrame =
this-Internals-MultiViewManager-getFrame(view);

I've tested this by:
multiViewFrame-setTitle(HELLO WORLD!);

and it works, but I've tried multiple tries to get the frame to split
without success.  Any insight will help.
Thanks!
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview


[Paraview] Application using Paraview library in C++

2010-01-25 Thread Adebayo Olowoyeye
Hi all,
  I am attempting to use paraview's library to visualize medical volumes in
an application I am building from scratch.  The program is written in C++.
I am having a hard time finding adequate documentation (forums and examples)
that shows how to build an application that uses paraview's library in C++.
I have ran the example program BasicApp.cxx and it works, but it uses a
SphereSource.  I am loading dicom images or .vtk images.  When I edit the
code for BasicApp.cxx to load .vtk files I get an error after setting the
representation to volume.  From reading similar problems on forums, I think
the problem pertains to colormaps and scalars, but I cannot find
documentation on how to fix this in C++.  I'm including my code below.  I
may be over complicating this, but any help is appreciated.
Thanks for your time!

using namespace std;

// our main window
class MainWindow : public QMainWindow
{
public:
  MainWindow()
  {
// automatically make a server connection
pqApplicationCore* core = pqApplicationCore::instance();
pqObjectBuilder* ob = core-getObjectBuilder();
pqServer* server = ob-createServer(
pqServerResource(builtin:));

// create a graphics window and put it in our main window
this-RenderView =
qobject_castpqRenderView*(ob-createView(pqRenderView::renderViewType(),
server));
this-setCentralWidget(this-RenderView-getWidget());

// create source and elevation filter
pqPipelineSource* source;
pqPipelineSource* elevation;

source = ob-createSource(sources, SphereSource, server);
// updating source so that when elevation filter is created, the
defaults
// are setup correctly using the correct data bounds etc.
vtkSMSourceProxy::SafeDownCast(source-getProxy())-UpdatePipeline();

QStringList files;
files.push_back(../brain.vtk);

pqPipelineSource *reader;
pqObjectBuilder *builder = core-getObjectBuilder();
reader = builder-createReader(QString(internal_sources),
QString(legacyreader), files, server);


pqDataRepresentation *repr =
ob-createDataRepresentation(reader-getOutputPort(0), this-RenderView);

if(repr){

vtkSMPropertyHelper(repr-getProxy(),
Representation).Set(vtkSMPVRepresentationProxy::VOLUME);

pqDisplayPolicy pqDisplayP = core-getDisplayPolicy();
repr-getProxy()-UpdateVTKObjects();

}

//elevation = ob-createFilter(filters, ElevationFilter, source);

// put the elevation in the window
//ob-createDataRepresentation(elevation-getOutputPort(0),
this-RenderView);

// zoom to sphere
this-RenderView-resetCamera();
// make sure we update
this-RenderView-render();
  }

  QPointerpqRenderView RenderView;

};
...
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview