Beispiel #1
0
// This is called by the system to terminate the editing of the
// parameters in the command panel.  
void ChBoxObject::EndEditParams( IObjParam *ip, ULONG flags,Animatable *next )
{
	SimpleObject::EndEditParams(ip,flags,next);
	this->ip = NULL;

	if (flags & END_EDIT_REMOVEUI ) {
		// Remove the rollup pages from the command panel.
		if (pmapCreate) DestroyCPParamMap(pmapCreate);
		if (pmapTypeIn) DestroyCPParamMap(pmapTypeIn);
		DestroyCPParamMap(pmapParam);
		pmapParam  = NULL;
		pmapTypeIn = NULL;
		pmapCreate = NULL;
	}
	else
	{
		pmapTypeIn->SetUserDlgProc(nullptr);
		pmapParam->SetUserDlgProc(nullptr);
		pmapCreate->SetParamBlock(nullptr);
		pmapTypeIn->SetParamBlock(nullptr);
		pmapParam->SetParamBlock(nullptr);
	}

	// Save these values in class variables so the next object 
	// created will inherit them.
	pblock->GetValue(PB_LSEGS,ip->GetTime(),dlgLSegs,FOREVER);
	pblock->GetValue(PB_WSEGS,ip->GetTime(),dlgWSegs,FOREVER);
	pblock->GetValue(PB_HSEGS,ip->GetTime(),dlgHSegs,FOREVER);	
	pblock->GetValue(PB_CSEGS,ip->GetTime(),dlgCSegs,FOREVER);	
}
Beispiel #2
0
void CExtObject::EndEditParams( IObjParam *ip, ULONG flags,Animatable *next )
{		
	SimpleObject::EndEditParams(ip,flags,next);
	this->ip = NULL;

	if (flags & END_EDIT_REMOVEUI ) {
		if (pmapCreate) DestroyCPParamMap(pmapCreate);
		if (pmapTypeIn) DestroyCPParamMap(pmapTypeIn);
		DestroyCPParamMap(pmapParam);
		pmapParam  = NULL;
		pmapTypeIn = NULL;
		pmapCreate = NULL;
	}
	else
	{
		pmapTypeIn->SetUserDlgProc(nullptr);
		pmapParam->SetUserDlgProc(nullptr);
		pmapCreate->SetParamBlock(nullptr);
		pmapTypeIn->SetParamBlock(nullptr);
		pmapParam->SetParamBlock(nullptr);
	}

	// Save these values in class variables so the next object created will inherit them.
	pblock->GetValue(PB_TSEGS,ip->GetTime(),dlgTSegs,FOREVER);
	pblock->GetValue(PB_SSEGS,ip->GetTime(),dlgSSegs,FOREVER);
	pblock->GetValue(PB_BSEGS,ip->GetTime(),dlgBSegs,FOREVER);
	pblock->GetValue(PB_WSEGS,ip->GetTime(),dlgWSegs,FOREVER);
	pblock->GetValue(PB_HSEGS,ip->GetTime(),dlgHSegs,FOREVER);
}
Beispiel #3
0
void TorusObject::EndEditParams( IObjParam *ip, ULONG flags,Animatable *next )
{
	SimpleObject::EndEditParams(ip,flags,next);
	this->ip = NULL;

	if (flags & END_EDIT_REMOVEUI ) {
		if (pmapCreate) DestroyCPParamMap(pmapCreate);
		if (pmapTypeIn) DestroyCPParamMap(pmapTypeIn);
		DestroyCPParamMap(pmapParam);
		pmapParam  = NULL;
		pmapTypeIn = NULL;
		pmapCreate = NULL;
	}
	else
	{
		pmapTypeIn->SetUserDlgProc(nullptr);
		pmapParam->SetUserDlgProc(nullptr);
		pmapCreate->SetParamBlock(nullptr);
		pmapTypeIn->SetParamBlock(nullptr);
		pmapParam->SetParamBlock(nullptr);
	}

	// Save these values in class variables so the next object created will inherit them.
	pblock->GetValue(PB_SIDES,ip->GetTime(),dlgSides,FOREVER);
	pblock->GetValue(PB_SEGMENTS,ip->GetTime(),dlgSegments,FOREVER);
	pblock->GetValue(PB_SMOOTH,ip->GetTime(),dlgSmooth,FOREVER);	
	pblock->GetValue(PB_RADIUS2,ip->GetTime(),dlgRadius2,FOREVER);		
}
Beispiel #4
0
void TorusObject::UpdateUI()
{
	if (ip == NULL)
		return;
	TorusParamDlgProc* dlg = static_cast<TorusParamDlgProc*>(pmapParam->GetUserDlgProc());
	dlg->Update(ip->GetTime());
}
Beispiel #5
0
void EllipseObject::UpdateUI(HWND hwnd)
{
	Interval valid;
	BOOL build_outine = FALSE;
	TimeValue t = ip? ip->GetTime() : 0;

	myParamBlock->GetValue(PB_OUTLINE, t, build_outine, valid);
	ICustEdit *thickness_edit = GetICustEdit(GetDlgItem(hwnd, IDC_THICKNESSEDIT));
	ISpinnerControl *thickness_spin = GetISpinner(GetDlgItem(hwnd, IDC_THICKSPINNER));

	if(!thickness_edit || !thickness_spin)
		return;

	if(build_outine)
	{
		EnableWindow(GetDlgItem(hwnd,IDC_THICKNESS_TEXT),TRUE);
		thickness_edit->Enable();
		thickness_spin->Enable();
	}
	else
	{
		EnableWindow(GetDlgItem(hwnd,IDC_THICKNESS_TEXT),FALSE);
		thickness_edit->Disable();
		thickness_spin->Disable();
	}

	ReleaseICustEdit(thickness_edit);
	ReleaseISpinner(thickness_spin);
}
Beispiel #6
0
void FExtrudeMod::BeginEditParams(
		IObjParam  *ip, ULONG flags,Animatable *prev)
	{
	this->ip = ip;
	editMod  = this;

	// Add our sub object type
	// TSTR type1(GetString(IDS_RB_EXTRUDECENT));
	// const TCHAR *ptype[] = {type1};
	// This call is obsolete. Please see BaseObject::NumSubObjTypes() and BaseObject::GetSubObjType()
	// ip->RegisterSubObjectTypes(ptype, 1);

	// Create sub object editing modes.
	moveMode    = new MoveModBoxCMode(this,ip);
	
	TimeValue t = ip->GetTime();
	NotifyDependents(Interval(t,t), PART_ALL, REFMSG_BEGIN_EDIT);
	NotifyDependents(Interval(t,t), PART_ALL, REFMSG_MOD_DISPLAY_ON);
	SetAFlag(A_MOD_BEING_EDITED);

	pmapParam = CreateCPParamMap(
		descParam,PARAMDESC_LENGTH,
		pblock,
		ip,
		hInstance,
		MAKEINTRESOURCE(IDD_FACEEXTRUDEPARAM),
		GetString(IDS_RB_PARAMETERS),
		0);	
	}
void bhkListObject::UpdateUI()
{
   if (ip == NULL)
      return;
   ListParamDlgProc* dlg = static_cast<ListParamDlgProc*>(pmapParam->GetUserDlgProc());
   dlg->Update(ip->GetTime());
}
Beispiel #8
0
void MirrorMod::EndEditParams(
		IObjParam *ip,ULONG flags,Animatable *next)
	{
	this->ip = NULL;
	editMod  = NULL;

	TimeValue t = ip->GetTime();

	// NOTE: This flag must be cleared before sending the REFMSG_END_EDIT
	ClearAFlag(A_MOD_BEING_EDITED);

	NotifyDependents(Interval(t,t), PART_ALL, REFMSG_END_EDIT);
	NotifyDependents(Interval(t,t), PART_ALL, REFMSG_MOD_DISPLAY_OFF);

	ip->DeleteMode(moveMode);
	ip->DeleteMode(rotMode);
	ip->DeleteMode(uscaleMode);
	ip->DeleteMode(nuscaleMode);
	ip->DeleteMode(squashMode);	
	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;

	DestroyCPParamMap(pmapParam);
	}
Beispiel #9
0
void BombObject::EndEditParams(IObjParam *ip,ULONG flags,Animatable *next)
	{
	if (flags&END_EDIT_REMOVEUI) {		
		ip->DeleteRollupPage(hParam);
		ip->DeleteRollupPage(hSot);
		hParam = NULL;
		hSot   = NULL;
	} else {		
      DLSetWindowLongPtr(hParam, 0);      
		}
	
	if (GetFalloffOn(ip->GetTime())) {
		NotifyDependents(FOREVER,0,REFMSG_CHANGE);
		ip->RedrawViews(ip->GetTime());
		}
	this->ip = NULL;
	}
Beispiel #10
0
void HelixObject::EndEditParams( IObjParam *ip,ULONG flags,Animatable *next )
	{
	SimpleShape::EndEditParams(ip,flags,next);
	this->ip = NULL;

	if (flags&END_EDIT_REMOVEUI ) {
		if (pmapCreate) DestroyCPParamMap(pmapCreate);
		if (pmapTypeIn) DestroyCPParamMap(pmapTypeIn);
		DestroyCPParamMap(pmapParam);
		pmapParam  = NULL;
		pmapTypeIn = NULL;
		pmapCreate = NULL;
		}

	// Save these values in class variables so the next object created will inherit them.
	pblock->GetValue(PB_TURNS,ip->GetTime(),dlgTurns,FOREVER);
	pblock->GetValue(PB_BIAS,ip->GetTime(),dlgBias,FOREVER);
	pblock->GetValue(PB_DIRECTION,ip->GetTime(),dlgDirection,FOREVER);
	}
Beispiel #11
0
void PrismObject::EndEditParams( IObjParam *ip, ULONG flags,Animatable *next )
	{		
	SimpleObject::EndEditParams(ip,flags,next);
	this->ip = NULL;

	if (flags&END_EDIT_REMOVEUI ) {
		if (pmapCreate) DestroyCPParamMap(pmapCreate);
		if (pmapTypeIn) DestroyCPParamMap(pmapTypeIn);
		DestroyCPParamMap(pmapParam);
		pmapParam  = NULL;
		pmapTypeIn = NULL;
		pmapCreate = NULL;
		}

	// Save these values in class variables so the next object created will inherit them.
	pblock->GetValue(PB_S1SEGS,ip->GetTime(),dlgSide1Segs,FOREVER);
	pblock->GetValue(PB_S2SEGS,ip->GetTime(),dlgSide2Segs,FOREVER);	
	pblock->GetValue(PB_S3SEGS,ip->GetTime(),dlgSide3Segs,FOREVER);	
	pblock->GetValue(PB_HSEGS,ip->GetTime(),dlgHSegs,FOREVER);		
	}
Beispiel #12
0
void SolidifyPW::EndEditParams( IObjParam *ip, ULONG flags,Animatable *next)
{
	hWnd = NULL;
	SolidifyPWDesc.EndEditParams(ip, this, flags, next);

	TimeValue t = ip->GetTime();
	ClearAFlag(A_MOD_BEING_EDITED);
	NotifyDependents(Interval(t,t), PART_ALL, REFMSG_END_EDIT);
	NotifyDependents(Interval(t,t), PART_ALL, REFMSG_MOD_DISPLAY_OFF);
	this->ip = NULL;
}
Beispiel #13
0
void SolidifyPW::BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev )
{
	this->ip = ip;
	TimeValue t = ip->GetTime();
	NotifyDependents(Interval(t,t), PART_ALL, REFMSG_BEGIN_EDIT);
	NotifyDependents(Interval(t,t), PART_ALL, REFMSG_MOD_DISPLAY_ON);
	SetAFlag(A_MOD_BEING_EDITED);	

	SolidifyPWDesc.BeginEditParams(ip, this, flags, prev);

	solidifypw_param_blk.SetUserDlgProc(solidifypw_params,new SolidifyPWDlgProc(this));

}
Beispiel #14
0
void RelaxMod::EndEditParams( IObjParam *ip, ULONG flags,Animatable *next) {
	this->ip = NULL;
	editMod = NULL;
	
	TimeValue t = ip->GetTime();

	// aszabo|feb.05.02 This flag must be cleared before sending the REFMSG_END_EDIT
	ClearAFlag(A_MOD_BEING_EDITED);
	NotifyDependents(Interval(t,t), PART_ALL, REFMSG_END_EDIT);
	NotifyDependents(Interval(t,t), PART_ALL, REFMSG_MOD_DISPLAY_OFF);

	DestroyCPParamMap(pmapParam);
	pmapParam = NULL;
}
Beispiel #15
0
void TriPatchObject::EndEditParams( IObjParam *ip, ULONG flags, Animatable *next )
	{
	editOb = NULL;
	this->ip = NULL;

	if (flags&END_EDIT_REMOVEUI ) {
		if (pmapTypeIn) DestroyCPParamMap(pmapTypeIn);
		DestroyCPParamMap(pmapParam);
		pmapParam  = NULL;
		pmapTypeIn = NULL;
		}

	// Save these values in class variables so the next object created will inherit them.
	pblock->GetValue(PB_TEXTURE,ip->GetTime(),dlgTexture,FOREVER);	
	}
Beispiel #16
0
void RendSpline::EndEditParams( IObjParam *ip, ULONG flags,Animatable *next)
{
	RendSplineDesc.EndEditParams(ip, this, flags, next);

	TimeValue t = ip->GetTime();

	paramDlgProc = NULL;
	ip->EnableShowEndResult(TRUE);


	ClearAFlag(A_MOD_BEING_EDITED);
	NotifyDependents(Interval(t,t), PART_ALL, REFMSG_END_EDIT);
	NotifyDependents(Interval(t,t), PART_ALL, REFMSG_MOD_DISPLAY_OFF);
	this->ip = NULL;
}
Beispiel #17
0
void RelaxMod::BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev ) {
	this->ip = ip;
	editMod = this;

	TimeValue t = ip->GetTime();
	NotifyDependents(Interval(t,t), PART_ALL, REFMSG_BEGIN_EDIT);
	NotifyDependents(Interval(t,t), PART_ALL, REFMSG_MOD_DISPLAY_ON);
	SetAFlag(A_MOD_BEING_EDITED);

	pmapParam = CreateCPParamMap(
		descParam,PARAMDESC_LENGTH,
		pblock,
		ip,
		hInstance,
		MAKEINTRESOURCE(IDD_RELAX),
		GetString (IDS_PARAMETERS),
		0);
}
Beispiel #18
0
void RendSpline::BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev )
{
	this->ip = ip;

	ip->EnableShowEndResult(FALSE);

	TimeValue t = ip->GetTime();
	NotifyDependents(Interval(t,t), PART_ALL, REFMSG_BEGIN_EDIT);
	NotifyDependents(Interval(t,t), PART_ALL, REFMSG_MOD_DISPLAY_ON);
	SetAFlag(A_MOD_BEING_EDITED);	

	RendSplineDesc.BeginEditParams(ip, this, flags, prev);

	// pointcache_param_blk.SetUserDlgProc(new PointCacheParamsMapDlgProc(this));

	paramDlgProc = new RendSplineParamsMapDlgProc(this);
	rendspline_param_blk.SetUserDlgProc(paramDlgProc);

}
Beispiel #19
0
void EditFaceDataMod::BeginEditParams (IObjParam  *ip, ULONG flags,Animatable *prev) {
	this->ip = ip;	
	editMod  = this;

	selectMode = new SelectModBoxCMode(this,ip);

	// Restore the selection level.
	ip->SetSubObjectLevel(selLevel);

	if (!hParams) {
		hParams = ip->AddRollupPage (hInstance, MAKEINTRESOURCE (IDD_FACEDATA_EDIT),
			FaceDataDlgProc, GetString (IDS_EDIT_FACE_DATA), (LPARAM)this, 0);
	} else {
		UpdateDialog ();
	}

	TimeValue t = ip->GetTime();
	NotifyDependents(Interval(t,t), PART_ALL, REFMSG_BEGIN_EDIT);
	NotifyDependents(Interval(t,t), PART_ALL, REFMSG_MOD_DISPLAY_ON);
	SetAFlag(A_MOD_BEING_EDITED);	
}
Beispiel #20
0
void EditFaceDataMod::EndEditParams (IObjParam *ip,ULONG flags,Animatable *next) {
	if (flags&END_EDIT_REMOVEUI ) {
		if (hParams) {
			ip->DeleteRollupPage(hParams);
			hParams = NULL;
		}
	}

	if (selectMode) {
		ip->DeleteMode(selectMode);
		delete selectMode;
	}
	selectMode = NULL;

	this->ip = NULL;
	editMod  = NULL;

	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);
}
void FaceDataToColorMod::DisplayColors () {
	if (!mpInterface) return;

	int channel = 0;
	if (mpParams) mpParams->GetValue (pb_channel, TimeValue(0), channel, FOREVER);

	ModContextList mcList;
	INodeTab nodes;
	mpInterface->GetModContexts(mcList,nodes);

	for (int nd = 0; nd<nodes.Count(); nd++) {
		nodes[nd]->SetCVertMode (true);
		nodes[nd]->SetShadeCVerts (true);
		if (channel) nodes[nd]->SetVertexColorType (nvct_illumination);
		else nodes[nd]->SetVertexColorType (nvct_color);
		//nodes[nd]->NotifyDependents (FOREVER, PART_DISPLAY, REFMSG_CHANGE);
	}

	// KLUGE: above notify dependents call only seems to set a limited refresh region.  Result looks bad.
	// So we do this instead:
	NotifyDependents (FOREVER, PART_DISPLAY, REFMSG_CHANGE);
	mpInterface->RedrawViews (mpInterface->GetTime());
}
Beispiel #22
0
void BombObject::BeginEditParams(IObjParam *ip,ULONG flags,Animatable *prev)
	{
	this->ip = ip;
	
	if (!hParam) {
		hSot = ip->AddRollupPage( 
				hInstance, 
				MAKEINTRESOURCE(IDD_BOMB_SOT),
				DefaultSOTProc,
				GetString(IDS_RB_SOT), 
				(LPARAM)ip,APPENDROLL_CLOSED);

		hParam = ip->AddRollupPage( 
				hInstance, 
				MAKEINTRESOURCE(IDD_BOMBPARAMS),
				BombParamProc,
				GetString(IDS_RB_BOMBPARAMS), 
				(LPARAM)this );
	} else {
      DLSetWindowLongPtr(hParam, this);      

		// Init the dialog to our values.
		strengthSpin->SetValue(GetStrength(ip->GetTime()),FALSE);
		gravSpin->SetValue(GetGravity(ip->GetTime()),FALSE );
		chaosSpin->SetValue(GetChaos(ip->GetTime()),FALSE );
		detSpin->SetValue(GetDetonation(ip->GetTime()),FALSE );
		spinSpin->SetValue(GetSpin(ip->GetTime()),FALSE);
		falloffSpin->SetValue(GetFalloff(ip->GetTime()),FALSE);
		minFragSpin->SetValue(GetMinFrag(ip->GetTime()),FALSE);
		maxFragSpin->SetValue(GetMaxFrag(ip->GetTime()),FALSE);
		seedSpin->SetValue(GetSeed(ip->GetTime()),FALSE);
		CheckDlgButton(hParam,IDC_FALLOFF_ON,GetFalloffOn(ip->GetTime()));
		}

	if (GetFalloffOn(ip->GetTime())) {
		NotifyDependents(FOREVER,0,REFMSG_CHANGE);
		ip->RedrawViews(ip->GetTime());
		}
	}
Beispiel #23
0
RefResult BombObject::NotifyRefChanged( 
		const Interval& changeInt,
		RefTargetHandle hTarget, 
		PartID& partID, 
		RefMessage message, 
		BOOL propagate )
	{					
	switch (message) {				
		case REFMSG_CHANGE:
			if (ip) UpdateUI(ip->GetTime());
			break;

		case REFMSG_GET_PARAM_DIM: { 
			GetParamDim *gpd = (GetParamDim*)partID;
			switch (gpd->index) {
				case PB_STRENGTH:
					gpd->dim = stdNormalizedDim;
					break;
				case PB_GRAVITY:
					gpd->dim = stdNormalizedDim;
					break;	
				case PB_CHAOS:
					gpd->dim = stdNormalizedDim;
					break;	
				case PB_DETONATION:
					gpd->dim = stdTimeDim;
					break;
				case PB_SPIN:
					gpd->dim = defaultDim;
					break;
				case PB_FALLOFF:
					gpd->dim = stdWorldDim;
					break;
				}
			return REF_HALT; 
			}

		case REFMSG_GET_PARAM_NAME: {
			GetParamName *gpn = (GetParamName*)partID;
			switch (gpn->index) {
				case PB_STRENGTH:
					gpn->name = GetString(IDS_RB_STRENGTH2);
					break;
				case PB_GRAVITY:
					gpn->name = GetString(IDS_RB_GRAVITY);
					break;	
				case PB_CHAOS:
					gpn->name = GetString(IDS_RB_CHAOS);
					break;	
				case PB_DETONATION:
					gpn->name = GetString(IDS_RB_DETONATION);
					break;
				case PB_SPIN:
					gpn->name = GetString(IDS_RB_SPIN);
					break;
				case PB_FALLOFF:
					gpn->name = GetString(IDS_RB_FALLOFF);
					break;
				}
			return REF_HALT; 
			}
		}
	return REF_SUCCEED;
	}
Beispiel #24
0
void ExtrudeMod::EndEditParams( IObjParam *ip, ULONG flags,Animatable *next)
	{
	this->ip = NULL;
	editMod = NULL;
	
	TimeValue t = ip->GetTime();

	ClearAFlag(A_MOD_BEING_EDITED);
	NotifyDependents(Interval(t,t), PART_ALL, REFMSG_END_EDIT);
	NotifyDependents(Interval(t,t), PART_ALL, REFMSG_MOD_DISPLAY_OFF);

	DestroyCPParamMap(pmapParam);

	// Save these values in class variables so the next object created will inherit them.
	pblock->GetValue(PB_AMOUNT,ip->GetTime(),dlgAmount,FOREVER);
	pblock->GetValue(PB_SEGS,ip->GetTime(),dlgSegs,FOREVER);
	if (dlgSegs<1) dlgSegs = 1;
	pblock->GetValue(PB_CAPSTART,ip->GetTime(),dlgCapStart,FOREVER);
	pblock->GetValue(PB_CAPEND,ip->GetTime(),dlgCapEnd,FOREVER);
	pblock->GetValue(PB_CAPTYPE,ip->GetTime(),dlgCapType,FOREVER);
	pblock->GetValue(PB_OUTPUT,ip->GetTime(),dlgOutput,FOREVER);
	pblock->GetValue(PB_MAPPING,ip->GetTime(),dlgMapping,FOREVER);
	pblock->GetValue(PB_GEN_MATIDS,ip->GetTime(),dlgGenMatIDs,FOREVER);
	pblock->GetValue(PB_USE_SHAPEIDS,ip->GetTime(),dlgUseShapeIDs,FOREVER);
	pblock->GetValue(PB_SMOOTH,ip->GetTime(),dlgSmooth,FOREVER);
	}