Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4331

[CONNECT C++] DgnRegionElementTool::_AcceptClosedElement

$
0
0

I'm attempting to write a tool to select closed elements.  DgnRegionElementTool seems a likely candidate.  I want to verify that the perimeter elements picked by the user are suitable.  My problem is that _OnPostLocate and _AcceptClosedElement are never called...

struct          PickRegionTool : DgnRegionElementTool
{
private:

    RegionParams    regionParams_;

protected:
    ///  PickRegionTool constructor. 
    PickRegionTool (int toolId) : DgnRegionElementTool () {SetCmdName (toolId, 0);}

    ///  Show valid flood region under the cursor without waiting for accept point. 
    virtual bool                _WantFloodDynamicArea () override {return true;}
    ///  Return true if the tool wants to process the original elements that were directly involved in creating the result region. 
    virtual bool                 _WantProcessOriginals () override {return false;}
    ///  Return true to allow physically closed open paths as boundary candidates. 
    virtual bool                  _AllowPhysicallyClosed ()  override {return false;}
    ///  Called from _OnPostLocate and _FilterAgendaEntries to reject invalid boundary candidates. 
    virtual bool                 _AcceptClosedElement  (ElementHandleCR  eh, WStringR  cantAcceptReason);
    ///  Create region using _GetRegionParams. 
    virtual RegionCreateMode    _GetRegionCreateMode () override {return REGION_CREATE_ByParams;}
    ///  Setup region params to create region by flood (or boolean). 
    virtual RegionParams const& _GetRegionParams () override;
    ///  Process a region element created by this tool. 
    virtual BentleyStatus       _OnProcessRegionResult (EditElementHandleR eeh) override;
    ///  Check for valid boundary candidates. 
    virtual bool                  _OnPostLocate (HitPathCP path, WStringR cantAcceptReason) override;
    ///  Test whether candidate shape is suitable for this tool. 
    bool    Acceptable            (ElementHandleCR    candidate) const;
    virtual void _OnRestartTool () override; // pure virtual method, sub-class must override!

public:

    static void InstallNewInstance (int toolId);
};

What switch do I need to flip to ensure that _OnPostLocate and _AcceptClosedElement are called?


Viewing all articles
Browse latest Browse all 4331

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>