コード例 #1
0
ファイル: polyxml.cpp プロジェクト: kevinzhwl/ObjectARXMod
AcRx::AppRetCode
acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt)
{
    switch(msg) {
    case AcRx::kInitAppMsg:
        acrxUnlockApplication(pkt);        // Try to allow unloading
        acrxRegisterAppMDIAware(pkt);

        if (acrxServiceIsRegistered("AsdkPoly") 
            && AsdkPoly::desc() != NULL
            && AcDbXmlObjectProtocol::desc() != NULL) {
            // add XML I/O protocol extension to AsdkPoly
            //
            gpPolyXmlExtension = new AcDbXmlPoly(AsdkPoly::desc());
            AsdkPoly::desc()->addX(AcDbXmlObjectProtocol::desc(), gpPolyXmlExtension);

            acrxBuildClassHierarchy();
            updateRegistry();
        }
        break;

    case AcRx::kUnloadAppMsg:
        if (acrxServiceIsRegistered("AsdkPoly") 
            && AsdkPoly::desc() != NULL
            && AcDbXmlObjectProtocol::desc() != NULL) {
            AsdkPoly::desc()->delX(AcDbXmlObjectProtocol::desc());
        }
        if (gpPolyXmlExtension)
            delete gpPolyXmlExtension;
        break;
    }
    return AcRx::kRetOK;
}
コード例 #2
0
ファイル: AsdkBody.cpp プロジェクト: Bohr27/ObjectARXCore
extern "C" AcRx::AppRetCode
acrxEntryPoint( AcRx::AppMsgCode msg, void *pkt )
{
    switch(msg)
    {
    case AcRx::kInitAppMsg:
		//intialize AsdkAmodeler
		//
        acrxLoadModule(_T("aecmodeler50.dbx"),0);
        // Try to allow unloading
        // 
        acrxUnlockApplication(pkt);
		//register as being MDI aware
		//
		acrxRegisterAppMDIAware(pkt);
		//initialize our custom class
		AsdkBody::rxInit();
		acrxBuildClassHierarchy();
        break;

    case AcRx::kUnloadAppMsg:
		deleteAcRxClass(AsdkBody::desc());
		//unload AsdkAModeler if we have been the
		//only one using it. (RX does reference counting)
		acrxUnloadModule(_T("aecmodeler50.dbx"));
        break;
    }
    return AcRx::kRetOK;
}
コード例 #3
0
ファイル: lab9amain.cpp プロジェクト: kevinzhwl/ObjectARXMod
//-----------------------------------------------------------------------------
//----- This is the entry point that makes a simple DLL an ARX.
//----- This entry point must be exported either by means of a def file
//----- or by the means of _declspec
extern "C" AcRx::AppRetCode acrxEntryPoint (AcRx::AppMsgCode msg, void *pkt) {
    switch (msg) {
		case AcRx::kInitAppMsg:
			//----- An ARX application is locked to memory by default.
			//----- You must make the following function call to unlock it.
			acrxDynamicLinker->unlockApplication (pkt) ;
			//----- Register as  MDI aware
			acrxDynamicLinker->registerAppMDIAware(pkt);
			//----- Register the OarxEmployee class into the AutoCAD runtime class hierachy
			OarxEmployee::rxInit () ;
			//----- Build-up the AutoCAD runtime class hierachy with the new class entry
			acrxBuildClassHierarchy () ;
			//----- Do not forget our ServiceName
			acrxDynamicLinker->registerService (EmployeeServiceName, new OarxEmployeeService) ;
			break ;
		case AcRx::kUnloadAppMsg:
			//----- Unregister the OarxEmployee class from the AutoCAD runtime
			//----- class hierachy. So AutoCAD will turn our custom entity into
			//----- a proxy entity when we are not there.
			deleteAcRxClass (OarxEmployee::desc ()) ;
			//----- Do not forget to remove the dictionary entry
			delete acrxServiceDictionary->remove (EmployeeServiceName) ;
			break ;
    }
    return (AcRx::kRetOK) ;
}
コード例 #4
0
ファイル: tempapp.cpp プロジェクト: kevinzhwl/ObjectARXMod
// Initialization function called from acrxEntryPoint during
// kInitAppMsg case.  This function is used to add commands
// to the command stack as well as adding protocol extension
// objects to classes in and custom classes to the ACRX
// runtime class hierarchy.
// 
void
initApp()
{
    acrxRegisterService("AsdkTemperature");

    AsdkEntTemperature::rxInit();
    acrxBuildClassHierarchy();

    pDefaultTemp = new AsdkDefaultTemperature();
    pRegionTemp = new AsdkRegionTemperature();
    pCircleTemp = new AsdkCircleTemperature();

    // Add the protocol extension objects to the appropriate
    // AcRxClass objects
    //
    AcDbEntity::desc()->addX(AsdkEntTemperature::desc(),
        pDefaultTemp);
    AcDbRegion::desc()->addX(AsdkEntTemperature::desc(),
        pRegionTemp);
    AcDbCircle::desc()->addX(AsdkEntTemperature::desc(),
        pCircleTemp);

    acedRegCmds->addCommand("ASDK_TEMPERATURE_APP",
        "ASDK_ENERGY", "ENERGY", ACRX_CMD_TRANSPARENT,
        energy);
}
コード例 #5
0
void
	initApp()
{
	acedRegCmds->addCommand( _T("ASDK_THIRD"), _T("ASDK_SNAP2PLINE"),    _T("SNAP2PLINE"),   ACRX_CMD_TRANSPARENT, snapToWholePolyline );
	acedRegCmds->addCommand( _T("ASDK_THIRD"), _T("ASDK_SNAP2SEG"),      _T("SNAP2SEG"),     ACRX_CMD_TRANSPARENT, snapToPolylineSegments );

	// Add parent protocol extension class description object to hierarchy
	AsdkThirdOsnapInfo::rxInit();
	acrxBuildClassHierarchy();

	// Create the protocol extension objects
	AsdkThirdOsnapEntityInfo *pEntityInfo = new AsdkThirdOsnapEntityInfo;
	AsdkThirdOsnapCurveInfo *pCurveInfo = new AsdkThirdOsnapCurveInfo;
	AsdkThirdOsnapPolylineInfo *pPolylineInfo = new AsdkThirdOsnapPolylineInfo;

	// Register the protocol extension object with parent class object
	AcDbEntity::desc()->addX( AsdkThirdOsnapInfo::desc(), pEntityInfo );
	AcDbCurve::desc()->addX( AsdkThirdOsnapInfo::desc(), pCurveInfo );
	AcDbPolyline::desc()->addX( AsdkThirdOsnapInfo::desc(), pPolylineInfo );

	acdbCustomOsnapManager()->addCustomOsnapMode( &thirdMode );
	acdbCustomOsnapManager()->activateOsnapMode( _T("_third") );

	snapToWholePolyline();
}
コード例 #6
0
ファイル: ArxDbgApp.cpp プロジェクト: kevinzhwl/ObjectARXMod
AcRx::AppRetCode
ArxDbgApp::initApp()
{
    acrxUnlockApplication(m_acadAppPtr);
    acrxDynamicLinker->registerAppMDIAware(m_acadAppPtr);

        // get the name of this app so we can find where other
        // things are located.
    CString appFileName = acedGetAppName();

    char dir[_MAX_DIR], drive[_MAX_DRIVE], path[_MAX_PATH];
    _splitpath(appFileName, drive, dir, NULL, NULL);
    _makepath(path, drive, dir, NULL, NULL);
    m_appPath = path;

	CWnd* splashScreen = startSplashScreen();

    registerClasses();
    registerCommands();
    acrxBuildClassHierarchy();

    m_appServicePtr = acrxRegisterService("ArxDbgServices");

    ArxDbgAppEditorReactor::getInstance();
    MapTestReactor::getInstance();

	registerDialogExtensions();
	registerAppMenu();

	endSplashScreen(splashScreen);

    m_didInit = true;
    return AcRx::kRetOK;
}
コード例 #7
0
ファイル: textstyl.cpp プロジェクト: kevinzhwl/ObjectARXMod
static void initAsdkTextStyleSamp()
{
    AsdkTextStyleSamp::rxInit();
    acrxBuildClassHierarchy();

    acedRegCmds->addCommand("ASDK_TEXTSTYLE_SAMP",
                            "ASDKSTYLESAMP",
                            "STYLESAMP",
                            ACRX_CMD_TRANSPARENT,
                            addAsdkTextStyleSampObject);
}
コード例 #8
0
ファイル: ownrshp.cpp プロジェクト: kevinzhwl/ObjectARXMod
// The initialization function is called from acrxEntryPoint() during
// kInitAppMsg case.  This function is used to add commands
// to the command stack and to add classes to the ACRX class
// hierarchy.
//
void
initApp()
{
    acedRegCmds->addCommand("ASDK_OWNERSHIP_COMMANDS",
                            "ASDK_CREATE", "CREATE",ACRX_CMD_MODAL, createObjs);
    acedRegCmds->addCommand("ASDK_OWNERSHIP_COMMANDS",
                            "ASDK_LISTREE", "LISTREE",ACRX_CMD_MODAL, listTree);

    AsdkOwnerDemo::rxInit();
    acrxBuildClassHierarchy();
}
コード例 #9
0
static void
initAsdkShellSamp()
{
    AsdkShellSamp::rxInit();
    acrxBuildClassHierarchy();

    acedRegCmds->addCommand(_T("ACGI_SHELL_SAMP"),
                            _T("ASDKMAKESHELL"),
                            _T("MAKESHELL"),
                            ACRX_CMD_TRANSPARENT,
                            addAsdkShellSampObject);
}
コード例 #10
0
ファイル: main.cpp プロジェクト: kevinzhwl/ObjectARXMod
static void
initApp(void)
{
    // register your own entities
    //
    AsdkMkrEntity::rxInit();
    AsdkMkrObject::rxInit();
    acrxBuildClassHierarchy();

    // register your autocad commands
    //
    acedRegCmds->addCommand( /*NOXLATE*/"ASDK_MKR", /*NOXLATE*/"ASDK_ADDOBJECTS", "ADDOBJECTS",
        ACRX_CMD_TRANSPARENT | ACRX_CMD_USEPICKSET, mkraddobjects );
}
コード例 #11
0
ファイル: main.cpp プロジェクト: kevinzhwl/ObjectARXMod
void
initApp()
{
    acedRegCmds->addCommand( "ASDK_DIVISOR", "ASDK_SNAP2PLINE",    "SNAP2PLINE",   ACRX_CMD_TRANSPARENT, snapToWholePolyline );
    acedRegCmds->addCommand( "ASDK_DIVISOR", "ASDK_SNAP2SEG",      "SNAP2SEG",     ACRX_CMD_TRANSPARENT, snapToPolylineSegments );

    // Add parent protocol extension class to hierarchy
    AsdkDivOsnapInfo<3>::rxInit();
    AsdkDivOsnapInfo<4>::rxInit();
    AsdkDivOsnapInfo<5>::rxInit();
    acrxBuildClassHierarchy();

    ASDK_DEFINE_DIVISOR_OSNAP(3,thirdMode,"_third");
    ASDK_DEFINE_DIVISOR_OSNAP(4,fourthMode,"_fourth");
    ASDK_DEFINE_DIVISOR_OSNAP(5,fifthMode,"_fifth");

    snapToWholePolyline();
}