[Paraview] Displaying a List of Strings in a popup [ParaView 3]

Mike Jackson imikejackson at gmail.com
Fri Jun 29 11:30:37 EDT 2007


Thanks for the hint. So I am trying what you suggested and I am not  
sure what "target" of ParaView these files should go with. I found  
vtkSMStringArrayHelper and vtkPVStringArrayHelper. I copied both into  
my source tree and added them to my sources in my  
ParaViewImport.cmake file. When I compile ParaView I get the following:

/Users/mjackson/Task_7/MXA_Workspace/PVPhaseField/src/vtk/ 
vtkSMStringArrayHelper.cxx:20:39: error: vtkSMInformationHelper.h: No  
such file or directory
/Users/mjackson/Task_7/MXA_Workspace/PVPhaseField/src/vtk/ 
vtkSMStringArrayHelper.cxx:20:39: error: vtkSMStringVectorProperty.h:  
No such file or directory
.
.
.

So I am guessing that I simply do not have these sources assigned to  
the proper target> Here is my ParaViewImport.cmake file:

# specify the name of the module
SET(MODULE_NAME PVPhaseField)

# specify the sources that should be wrapped
SET(PVPhaseField_WRAPPED_SRCS
     ${PVPhaseField_SOURCE_DIR}/src/Readers/vtkH5PhaseFieldReader.cpp
     ${PVPhaseField_SOURCE_DIR}/src/vtk/vtkPVStringArrayHelper.cxx

)

SET (PVPhaseField_HEADERS
     ${PVPhaseField_SOURCE_DIR}/src/Readers/vtkH5PhaseFieldReader.h
     ${PVPhaseField_SOURCE_DIR}/src/Readers/PFConstants.h
     ${PVPhaseField_SOURCE_DIR}/src/Readers/matrices.h
     ${PVPhaseField_SOURCE_DIR}/src/vtk/vtkPVStringArrayHelper.h
     ${PVPhaseField_SOURCE_DIR}/src/vtk/vtkSMStringArrayHelper.h
)

SET ( PVPhaseField_SRCS
     ${PVPhaseField_SOURCE_DIR}/src/vtk/vtkSMStringArrayHelper.cxx
   )

INCLUDE_DIRECTORIES(    "${PVPhaseField_SOURCE_DIR}"
                         "${PVPhaseField_SOURCE_DIR}/../"
                         "${PVPhaseField_SOURCE_DIR}/src/"
                         "${PVPhaseField_SOURCE_DIR}/src/Readers"
                         "${PVPhaseField_SOURCE_DIR}/src/Filters"
                         "${PVPhaseField_SOURCE_DIR}/src/vtk"
                    )

INCLUDE (${PVPhaseField_SOURCE_DIR}/Resources/FindBoost.cmake)
IF(NOT Boost_FOUND)
   MESSAGE(FATAL_ERROR "Boost was not found. ${Boost_DIR_MESSAGE}")
ENDIF(NOT Boost_FOUND)

INCLUDE( ${PVPhaseField_SOURCE_DIR}/Resources/FindMXADataModel.cmake)
LINK_DIRECTORIES( ${MXADataModel_LIB_DIR} )
LINK_LIBRARIES (  ${MXADataModel_LIBRARIES} )

MESSAGE (STATUS "Compiling PVPhaseField into Paraview 3.x")
#-- Invoke this Macro to add the sources to paraview and
#-- wrap them for the client server
PARAVIEW_INCLUDE_WRAPPED_SOURCES ("${PVPhaseField_WRAPPED_SRCS}")

#-- Invoke this macro to include non-wrapped sources in the build
PARAVIEW_INCLUDE_SOURCES("${PVPhaseField_SRCS}")

# Place the package configuration file into the build tree.
CONFIGURE_FILE(${PVPhaseField_SOURCE_DIR}/xml/${MODULE_NAME}_GUI.xml
                ${LIBRARY_OUTPUT_PATH}/${MODULE_NAME}.xml @ONLY  
IMMEDIATE)

# Place the package configuration file into the build tree.
CONFIGURE_FILE(${PVPhaseField_SOURCE_DIR}/xml/${MODULE_NAME}_PVSM.xml
                ${LIBRARY_OUTPUT_PATH}/${MODULE_NAME}.pvsm @ONLY  
IMMEDIATE)


# -- Add the Server Manager XML
PARAVIEW_INCLUDE_SERVERMANAGER_RESOURCES(${LIBRARY_OUTPUT_PATH}/$ 
{MODULE_NAME}.pvsm)
# -- Add the Client side xml
PARAVIEW_INCLUDE_GUI_RESOURCES("${LIBRARY_OUTPUT_PATH}/$ 
{MODULE_NAME}.xml")


Could someone point to what I might be doing wrong?

-- 
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services


On Jun 28, 2007, at 11:56 AM, clinton at elemtech.com wrote:

>
> I don't see an example that does exactly what you want.
> But here's something that might work (untested).
>
> <StringVectorProperty
>         name="PhaseNameInfo"
>         command="GetPhaseList"
>         information_only="1">
>         <StringArrayHelper/>
>   </StringVectorProperty>
>
> <StringVectorProperty
>       name="PhaseName"
>       command="SetPhase"
>       number_of_elements="1">
>      <StringListDomain name="operation">
>         <RequiredProperties>
>           <Property name="PhaseNameInfo" function="ArraySelection"/>
>         </RequiredProperties>
>      </StringListDomain>
> </StringVectorProperty>
>
> That's assuming your reader has a SetPhase function.
> The PhaseNameInfo is used to get the list of available strings, by  
> calling
> GetPhaseList which returns a vtkStringArray.
> Note how the PhaseNameInfo is tied to the domain of the PhaseName  
> property.
> The PhaseName property is used to set the selection on the reader.
> The GUI would give you a combo box to choose one string from a list.
>
> StringArrayHelper is new and doesn't exist in 3.0.  You might be  
> able to copy
> it from the CVS head, rename it and include it in your plugin.
>
> This approach might be easier in the long run, as you'll have less  
> code to
> maintain yourself.
>
> Clint
>
> On Thursday 28 June 2007 8:15:23 am Mike Jackson wrote:
>> I am writing a plugin for ParaView 3 and I am going with the idea of
>> having ParaView 3 autogenerate the GUI for my Reader. (We are
>> prototyping at this point).
>>     I need to retrieve a list of Strings from my Data File to display
>> to the user so the user can then select one of those string values. I
>> generally understand all the C++ code part. It is the Server Manager
>> XML that I am getting hung up on. I have been reading through the
>> ParaView book and looking through some of the XML files in ParaView 3
>> source code. It would seem I need something like:
>>
>> <StringVectorProperty
>>          name="PhaseName"
>>          command="GetPhaseList"
>>          information_only="1">
>>          <SimpleStringInformationHelper/>
>>       </StringVectorProperty>
>>
>> I know I need some sort of Information Helper so something.. Could
>> someone shed some light or point me to an example? Whether the list
>> is in a popup or traditiional List box does not really matter. If it
>> can ONLY be done with a list of 'ints' I could hack something
>> together to make that work...
>>
>> Thanks
>> --
>> Mike Jackson
>> imikejackson & gmail * com
>>
>>
>>
>> _______________________________________________
>> ParaView mailing list
>> ParaView at paraview.org
>> http://www.paraview.org/mailman/listinfo/paraview
>
>
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview



More information about the ParaView mailing list