Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Create a derived class of A3DTreeVisitor including visitEnter method for A3DPartConnector

    Code Block
    languagecpp
    ...
    static MY_CHAR acLogFileName[_MAX_PATH * 2];
    
    class bodyOperationVisitor: public A3DTreeVisitor
    {
    public:
    	bodyOperationVisitor(A3DVisitorContainer* psContainer = NULL) : A3DTreeVisitor(psContainer) {};
    	~bodyOperationVisitor() {};
    
    public:
    	virtual A3DStatus visitEnter(const A3DPartConnector& sConnector) override
    	{
    		A3DStatus iRet = A3DTreeVisitor::visitEnter(sConnector);
    
    		// My processes
    
    		return iRet;
    	}
    };
    
    void traverseModelFile(A3DAsmModelFile* pModelFile)
    ...

  2. Use the derived bodyOperationVisitor class instead of A3DTessVisitor in the traverseModelFile function

    Code Block
    languagecpp
    ...
    	// Prepare body operation visitor and set to the container
    	bodyOperationVisitor *pBodyOpVisitor = new bodyOperationVisitor(&sA3DVisitorContainer);
    	sA3DVisitorContainer.push(pBodyOpVisitor);
    ...

  3. Build the project

  4. Create break points in the bodyOperationVisitor class and verify that the class is called during run time

Info

Thanks to the bodyOperaitonVisitor bodyOperationVisitor, you can add inquiry and update functions while model file traversing.

Implementing functions and timing for splitting multi body part will be the following image:

...