Example #1
0
void PaintPatchMod::EndEditParams(IObjParam *ip, ULONG flags, Animatable *next)
{
	if (hOpsPanel)
	{
		rsOps = IsRollupPanelOpen(hOpsPanel);
		ip->DeleteRollupPage(hOpsPanel);
		hOpsPanel = NULL;
	}
	
	// Enable show end result
	ip->EnableShowEndResult(TRUE);
	
	CancelEditPatchModes(ip);

	if (ip->GetCommandMode()->ID()==CID_EP_PAINT)
		ip->SetStdCommandMode(CID_OBJMOVE);
	
	TimeValue t = ip->GetTime();
	NotifyDependents(Interval(t, t), PART_ALL, REFMSG_END_EDIT);
	NotifyDependents(Interval(t, t), PART_ALL, REFMSG_MOD_DISPLAY_OFF);
	ClearAFlag(A_MOD_BEING_EDITED);
	
	DeletePatchDataTempData();
	this->ip = NULL;
	
	ip->DeleteMode(paintMode);
	
	if (paintMode)
		delete paintMode;
	paintMode = NULL;
}
Example #2
0
void EditPatchMod::RefreshSelType() 
{
	if (!hSelectPanel)
		return;
	if (hOpsPanel)
	{
		// Set up or remove the surface properties rollup if needed
		if (hSurfPanel)
		{
			rsSurf = IsRollupPanelOpen(hSurfPanel);
			ip->DeleteRollupPage(hSurfPanel);
			hSurfPanel = NULL;
		}
		if (hTilePanel)
		{
			rsTile = IsRollupPanelOpen(hTilePanel);
			ip->DeleteRollupPage(hTilePanel);
			hTilePanel = NULL;
		}
		if (hEdgePanel)
		{
			rsEdge = IsRollupPanelOpen(hEdgePanel);
			ip->DeleteRollupPage(hEdgePanel);
			hEdgePanel = NULL;
		}
		/* watje 3 - 18 - 99
		if (selLevel == EP_OBJECT)
		{
		hSurfPanel = ip->AddRollupPage(hInstance, MAKEINTRESOURCE(IDD_EDPATCH_SURF_OBJ),
		PatchObjSurfDlgProc, GetString(IDS_TH_SURFACEPROPERTIES), (LPARAM) this, rsSurf ? 0 : APPENDROLL_CLOSED);
		}
		else
		*/
		if (selLevel == EP_PATCH)
		{
			hSurfPanel = ip->AddRollupPage(hInstance, MAKEINTRESOURCE(IDD_EDPATCH_SURF),
				PatchSurfDlgProc, GetString(IDS_TH_SURFACEPROPERTIES), (LPARAM) this, rsSurf ? 0 : APPENDROLL_CLOSED);
		}
		if (selLevel == EP_TILE)
		{
			hTilePanel = ip->AddRollupPage(hInstance, MAKEINTRESOURCE(IDD_EDPATCH_TILE),
				PatchTileDlgProc, "Tile Properties", (LPARAM) this, rsTile ? 0 : APPENDROLL_CLOSED);
		}
		if (selLevel == EP_EDGE)
		{
			hEdgePanel = ip->AddRollupPage(hInstance, MAKEINTRESOURCE(IDD_EDPATCH_EDGE),
				PatchEdgeDlgProc, "Edge Properties", (LPARAM) this, rsEdge ? 0 : APPENDROLL_CLOSED);
		}
		SetSurfDlgEnables();
		SetTileDlgEnables();
		SetEdgeDlgEnables();
	}
	
	ICustToolbar *iToolbar = GetICustToolbar(GetDlgItem(hSelectPanel, IDC_SELTYPE));
	ICustButton *but;
	for (int i = 1; i < 5; i++)
	{
		but = iToolbar->GetICustButton(butIDs[i]);
		but->SetCheck(GetSubobjectLevel() == i);
		ReleaseICustButton(but);
	}
	ReleaseICustToolbar(iToolbar);
	SetSelDlgEnables();
	SetOpsDlgEnables();
	UpdateSelectDisplay();
	PatchSelChanged();
}
Example #3
0
void EditPatchMod::EndEditParams(IObjParam *ip, ULONG flags, Animatable *next)
{
    if (hSelectPanel)
    {
        rsSel = IsRollupPanelOpen(hSelectPanel);
        ip->DeleteRollupPage(hSelectPanel);
        hSelectPanel = NULL;
    }
    if (hOpsPanel)
    {
        rsOps = IsRollupPanelOpen(hOpsPanel);
        ip->DeleteRollupPage(hOpsPanel);
        hOpsPanel = NULL;
    }
    if (hSurfPanel)
    {
        rsSurf = IsRollupPanelOpen(hSurfPanel);
        ip->DeleteRollupPage(hSurfPanel);
        hSurfPanel = NULL;
    }
    if (hTilePanel)
    {
        rsTile = IsRollupPanelOpen(hTilePanel);
        ip->DeleteRollupPage(hTilePanel);
        hTilePanel = NULL;
    }
    if (hEdgePanel)
    {
        rsEdge = IsRollupPanelOpen(hEdgePanel);
        ip->DeleteRollupPage(hEdgePanel);
        hEdgePanel = NULL;
    }

    // Enable show end result
    ip->EnableShowEndResult(TRUE);

    CancelEditPatchModes(ip);

    if (ip->GetCommandMode()->ID()==CID_EP_PAINT)
        ip->SetStdCommandMode(CID_OBJMOVE);

    TimeValue t = ip->GetTime();
    NotifyDependents(Interval(t, t), PART_ALL, REFMSG_END_EDIT);
    NotifyDependents(Interval(t, t), PART_ALL, REFMSG_MOD_DISPLAY_OFF);
    ClearAFlag(A_MOD_BEING_EDITED);

    DeletePatchDataTempData();
    this->ip = NULL;

    //	if ( ip->GetCommandMode()->ID() == CID_EP_EXTRUDE ) ip->SetStdCommandMode( CID_OBJMOVE );
    //	if ( ip->GetCommandMode()->ID() == CID_EP_BEVEL ) ip->SetStdCommandMode( CID_OBJMOVE );

    ip->DeleteMode(moveMode);
    ip->DeleteMode(rotMode);
    ip->DeleteMode(uscaleMode);
    ip->DeleteMode(nuscaleMode);
    ip->DeleteMode(squashMode);
    ip->DeleteMode(selectMode);
    ip->DeleteMode(extrudeMode);
    ip->DeleteMode(bevelMode);
    ip->DeleteMode(bindMode);

    if (moveMode)
        delete moveMode;
    moveMode = NULL;
    if (rotMode)
        delete rotMode;
    rotMode = NULL;
    if (uscaleMode)
        delete uscaleMode;
    uscaleMode = NULL;
    if (nuscaleMode)
        delete nuscaleMode;
    nuscaleMode = NULL;
    if (squashMode)
        delete squashMode;
    squashMode = NULL;
    if (selectMode)
        delete selectMode;
    selectMode = NULL;

    if (extrudeMode)
        delete extrudeMode;
    extrudeMode = NULL;

    if (bevelMode)
        delete bevelMode;
    bevelMode = NULL;
    if (bindMode)
        delete bindMode;
    bindMode = NULL;
}