hello all:
    I want to add vtkHAVSvolumemapper to paraview as a plugin! here is my
xml file:
when I run paraview and load the plugin and open a data, the program will
give me an error message "access violation". anybody know what's wrong with
it? I also upload my .h .cxx and cmakelist file in accessory! any help will
be appreciate! thank you!

<ServerManaerConfiguration>
  <ProxyGroup name="mappers">
    <SourceProxy name="MyHAVSMapper"
      class="vtkMyHAVSMapper"
     >
      <!-- And any extra properties for this mapper -->
    </SourceProxy>
  </ProxyGroup>

  <ProxyGroup name="representations">
    <UnstructuredGridVolumeRepresentationProxy name="MyHAVSRepresentation"
      base_proxygroup="representations">
      <Documentation>
        This is the new representation type we are adding. This is identical
to
        the SurfaceRepresentation except that we are overriding the mapper
with
        our mapper.
      </Documentation>

      <InputProperty name="Input"
        command="NotUsed">
        <InputArrayDomain name="input_array_any"
          attribute_type="any">
        </InputArrayDomain>
      </InputProperty>

      <SubProxy>
        <Proxy name="Mapper" proxygroup="mappers"
               proxyname="MyHAVSMapper"
               override="1" />
        <ExposedProperties>
          <Property name="LookupTable" />
          <Property name="MapScalars" />
          <Property name="ImmediateModeRendering" />
          <Property name="InterpolateScalarsBeforeMapping" />
          <Property name="UseLookupTableScalarRange" />
          <Property name="ClippingPlanes" />
          <Property name="StaticMode" />
        </ExposedProperties>
      </SubProxy>

      <SubProxy>
        <Proxy name="LODMapper"
          proxygroup="mappers"
          proxyname="MyHAVSMapper" override="1"/>
        <ShareProperties subproxy="Mapper" >
          <Exception name="Input" />
        </ShareProperties>
      </SubProxy>

    <!-- End of SurfaceRepresentation -->
    </UnstructuredGridVolumeRepresentationProxy>

    <Extension name="UnstructuredGridRepresentation">
      <Documentation>
        Extends standard UnstructuredGridRepresentation by adding
        MySpecialRepresentation as a new type of representation.
      </Documentation>

      <!-- this adds to what is already defined in PVRepresentationBase -->
      <RepresentationType subproxy="MyHAVSRepresentation"
        text="HAVSMapper" subtype="1" />

      <SubProxy>
        <Proxy name="MyHAVSRepresentation"
          proxygroup="representations" proxyname="MyHAVSRepresentation">
        </Proxy>
        <ShareProperties subproxy="SurfaceRepresentation">
          <Exception name="Input" />
          <Exception name="Visibility" />
          <Exception name="Representation" />
        </ShareProperties>
      </SubProxy>
    </Extension>
  </ProxyGroup>

</ServerManaerConfiguration>
cmake_minimum_required(VERSION 2.6)

  FIND_PACKAGE(ParaView REQUIRED)
  INCLUDE(${PARAVIEW_USE_FILE})


ADD_PARAVIEW_PLUGIN(Representation2 "1.0"
  SERVER_MANAGER_XML Representation2.xml
  SERVER_MANAGER_SOURCES vtkMyHAVSMapper.cxx)
<ServerManaerConfiguration>
  <ProxyGroup name="mappers">
    <SourceProxy name="MyHAVSMapper"
      class="vtkMyHAVSMapper"
     >
      <!-- And any extra properties for this mapper -->
    </SourceProxy>
  </ProxyGroup>

  <ProxyGroup name="representations">
    <UnstructuredGridVolumeRepresentationProxy name="MyHAVSRepresentation" 
      base_proxygroup="representations">
      <Documentation>
        This is the new representation type we are adding. This is identical to
        the SurfaceRepresentation except that we are overriding the mapper with
        our mapper.
      </Documentation>
      
      <InputProperty name="Input" 
        command="NotUsed">
        <InputArrayDomain name="input_array_any"
          attribute_type="any">
        </InputArrayDomain>
      </InputProperty>

      <SubProxy>
        <Proxy name="Mapper" proxygroup="mappers"
               proxyname="MyHAVSMapper"
               override="1" />
        <ExposedProperties>
          <Property name="LookupTable" />
          <Property name="MapScalars" />
          <Property name="ImmediateModeRendering" />
          <Property name="InterpolateScalarsBeforeMapping" />
          <Property name="UseLookupTableScalarRange" />
          <Property name="ClippingPlanes" />
          <Property name="StaticMode" />
        </ExposedProperties>
      </SubProxy>

      <SubProxy>
        <Proxy name="LODMapper" 
          proxygroup="mappers"
          proxyname="MyHAVSMapper" override="1"/>
        <ShareProperties subproxy="Mapper" >
          <Exception name="Input" />
        </ShareProperties>
      </SubProxy>

    <!-- End of SurfaceRepresentation -->
    </UnstructuredGridVolumeRepresentationProxy>

    <Extension name="UnstructuredGridRepresentation">
      <Documentation>
        Extends standard UnstructuredGridRepresentation by adding
        MySpecialRepresentation as a new type of representation.
      </Documentation>

      <!-- this adds to what is already defined in PVRepresentationBase -->
      <RepresentationType subproxy="MyHAVSRepresentation"
        text="HAVSMapper" subtype="1" />

      <SubProxy>
        <Proxy name="MyHAVSRepresentation"
          proxygroup="representations" proxyname="MyHAVSRepresentation">
        </Proxy>
        <ShareProperties subproxy="SurfaceRepresentation">
          <Exception name="Input" />
          <Exception name="Visibility" />
          <Exception name="Representation" />
        </ShareProperties>
      </SubProxy>
    </Extension>
  </ProxyGroup>

</ServerManaerConfiguration>

Attachment: vtkMyHAVSMapper.cxx
Description: Binary data

/*=========================================================================

  Program:   ParaView
  Module:    $RCSfile: vtkuOpenGLMapper.h,v $

  Copyright (c) Kitware, Inc.
  All rights reserved.
  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
// .NAME vtkuOpenGLMapper - dummy special polydata mapper.
// .SECTION Description
// This is a place holder for a poly data mapper. This example simply uses the
// standard polydata mapper

#ifndef __vtkMyHAVSMapper_h
#define __vtkMyHAVSMapper_h

//#include "vtkPolyDataMapper.h"
#include "vtkOpenGLHAVSVolumeMapper.h"

class VTK_EXPORT vtkMyHAVSMapper : public vtkOpenGLHAVSVolumeMapper
{
public:
  static vtkMyHAVSMapper* New();
  vtkTypeMacro(vtkMyHAVSMapper, vtkOpenGLHAVSVolumeMapper);
  void PrintSelf(ostream& os, vtkIndent indent);


protected:
  vtkMyHAVSMapper();
  ~vtkMyHAVSMapper();

private:
  vtkMyHAVSMapper(const vtkMyHAVSMapper&); // Not implemented
  void operator=(const vtkMyHAVSMapper&); // Not implemented
//ETX
};

#endif

_______________________________________________
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

Reply via email to