Example #1
0
    // Static void method with same signature as "Main" is always
    // file base name:
    //
    /// <summary>
    /// VTK test Main method
    /// </summary>
    public static void vtkActor2DTest(string[] args)
    {
        Kitware.VTK.vtkActor2D a = new Kitware.VTK.vtkActor2D();
        System.Console.Error.WriteLine(a.ToString());

        double [] da = a.GetBounds();
        if (null == da)
        {
            System.Console.Error.WriteLine("da is null");
        }
        else
        {
            System.Console.Error.WriteLine(da.ToString());
        }
    }
Example #2
0
    // Static void method with same signature as "Main" is always
    // file base name:
    //
    /// <summary>
    /// VTK test Main method
    /// </summary>
    public static void vtkActor2DTest(string[] args)
    {
        Kitware.VTK.vtkActor2D a = new Kitware.VTK.vtkActor2D();
        System.Console.Error.WriteLine(a.ToString());

        double [] da = a.GetBounds();
        if (null == da)
        {
          System.Console.Error.WriteLine("da is null");
        }
        else
        {
          System.Console.Error.WriteLine(da.ToString());
        }
    }
    // Static void method with same signature as "Main" is always
    // file base name:
    //
    /// <summary>
    /// VTK test Main method
    /// </summary>
    public static void vtkObjectModifiedEvtTest(string[] args)
    {
        ObjectModifiedCallCount = 0;

        // Create an object to send an event:
        //
        Kitware.VTK.vtkActor2D sender = new Kitware.VTK.vtkActor2D();

        // Connect a new handler for the Modified event:
        //
        Kitware.VTK.vtkObject.vtkObjectEventHandler handler =
          new Kitware.VTK.vtkObject.vtkObjectEventHandler(ObjectModified);

        sender.ModifiedEvt += handler;

        // Trigger the event:
        //
        sender.Modified();

        // Toggle Debug, trigger event again, then turn off Debug before objects are destroyed...
        //
        sender.SetDebug((byte)((0 == sender.GetDebug()) ? 1 : 0));
        sender.Modified();
        sender.DebugOff();

        // Disconnect them:
        //
        sender.ModifiedEvt -= handler;

        if (2 != ObjectModifiedCallCount)
        {
          throw new System.Exception(System.String.Format(
        "error: ObjectModified was called {0} times. Expected exactly 2 calls.",
        ObjectModifiedCallCount));
        }
    }
    // Static void method with same signature as "Main" is always
    // file base name:
    //
    /// <summary>
    /// VTK test Main method
    /// </summary>
    public static void vtkObjectModifiedEvtTest(string[] args)
    {
        ObjectModifiedCallCount = 0;

        // Create an object to send an event:
        //
        Kitware.VTK.vtkActor2D sender = new Kitware.VTK.vtkActor2D();

        // Connect a new handler for the Modified event:
        //
        Kitware.VTK.vtkObject.vtkObjectEventHandler handler =
            new Kitware.VTK.vtkObject.vtkObjectEventHandler(ObjectModified);

        sender.ModifiedEvt += handler;

        // Trigger the event:
        //
        sender.Modified();

        // Toggle Debug, trigger event again, then turn off Debug before objects are destroyed...
        //
        sender.SetDebug((byte)((0 == sender.GetDebug()) ? 1 : 0));
        sender.Modified();
        sender.DebugOff();

        // Disconnect them:
        //
        sender.ModifiedEvt -= handler;

        if (2 != ObjectModifiedCallCount)
        {
            throw new System.Exception(System.String.Format(
                                           "error: ObjectModified was called {0} times. Expected exactly 2 calls.",
                                           ObjectModifiedCallCount));
        }
    }