Specifying the interactor

The CreateInteractor function is the core of your tool. The CursorTools framework calls this function as the result of your MouseDown event. This specifies the specific interactor you want to return as the result of someone clicking somewhere while using your tool. Specify the interactor that you create here, which in turn, draws the graphic that you create.

      // Copyright (C) 1995 Taligent, Inc. All rights reserved.
      TToolInteractor*
      TCanvasPolygonCreationTool::CreateInteractor (MToolTarget* target) const
      {
          TCanvasPolygonCreationInteractor* theInteractor = NIL;
          
          MCanvasSelection *selection = NIL;
          ::DynamicCastTo (selection, target);
          
          if ( selection ) {
              theInteractor = new TCanvasPolygonCreationInteractor (
                              selection, 
                              ::NonConst(*this)->GetToolHandler());
                                      
              theInteractor->SetCoordinateView (::NonConst(*this)->GetToolView());
              }
      
          return theInteractor;
      }

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker