示例#1
0
IntPtr GuiEnv_AddInOutFader(IntPtr guienv, M_RECT rectangle, IntPtr parent, int id)
{
	if(rectangle != NULL)
		return GetGui(guienv)->addInOutFader(&MU_RECT(rectangle), (IGUIElement*)parent, id);
	else
		return GetGui(guienv)->addInOutFader(NULL, (IGUIElement*)parent, id);
}
示例#2
0
/*
==============
sdRadialMenuModule::HandleGuiEvent
==============
*/
bool sdRadialMenuModule::HandleGuiEvent( const sdSysEvent* event ) {
	// always eat mouse events that come from the controller
	bool controllerMouse = event->IsControllerMouseEvent();
	if ( g_radialMenuMouseInput.GetInteger() == 0 && 
		!controllerMouse &&
		( event->IsMouseEvent() ||
		( event->IsMouseButtonEvent() ) ) ) {
		return false;
	}

	// ignore mouse movement if it's a vertical quick chat
	if ( g_radialMenuStyle.GetInteger() == 1 && event->IsMouseEvent() ) {
		return false;
	}

	sdUserInterfaceLocal* ui = GetGui();
	bool retVal = ui ? ui->PostEvent( event ) : false;

	if ( !retVal ) {
		retVal |= sdHudModule::HandleGuiEvent( event );
	}

	if( controllerMouse ) {
		return true;
	}

	return ( g_radialMenuMouseInput.GetInteger() == 2 && event->IsMouseEvent() ) ? false : retVal;
}
示例#3
0
void idRenderWindow::PreRender() {
	if (needsRender) {
		world->InitFromMap( NULL );
		idDict spawnArgs;
		spawnArgs.Set("classname", "light");
		spawnArgs.Set("name", "light_1");
		spawnArgs.Set("origin", lightOrigin.ToVec3().ToString());
		spawnArgs.Set("_color", lightColor.ToVec3().ToString());
		gameEdit->ParseSpawnArgsToRenderLight( &spawnArgs, &rLight );
		lightDef = world->AddLightDef( &rLight );
		if ( !modelName[0] ) {
			common->Warning( "Window '%s' in gui '%s': no model set", GetName(), GetGui()->GetSourceFile() );
		}
		memset( &worldEntity, 0, sizeof( worldEntity ) );
		spawnArgs.Clear();
		spawnArgs.Set("classname", "func_static");
		spawnArgs.Set("model", modelName);
		spawnArgs.Set("origin", modelOrigin.c_str());
		gameEdit->ParseSpawnArgsToRenderEntity( &spawnArgs, &worldEntity );
		if ( worldEntity.hModel ) {
			idVec3 v = modelRotate.ToVec3();
			worldEntity.axis = v.ToMat3();
			worldEntity.shaderParms[0] = 1;
			worldEntity.shaderParms[1] = 1;
			worldEntity.shaderParms[2] = 1;
			worldEntity.shaderParms[3] = 1;
			modelDef = world->AddEntityDef( &worldEntity );
		}
		needsRender = false;
	}
}
示例#4
0
/*
==============
sdFireTeamMenu::HandleGuiEvent
==============
*/
bool sdFireTeamMenu::HandleGuiEvent( const sdSysEvent* event ) {
	sdUserInterfaceLocal* ui = GetGui();
	if( ui && ui->PostEvent( event ) ) {
		return true;
	}

	return sdHudModule::HandleGuiEvent( event );		
}
示例#5
0
/*
==============
sdTakeViewNoteMenu::HandleGuiEvent
==============
*/
bool sdTakeViewNoteMenu::HandleGuiEvent( const sdSysEvent* event ) {
	if ( sdHudModule::HandleGuiEvent( event ) ) {
		return true;
	}

	sdUserInterfaceLocal* ui = GetGui();
	return ui ? ui->PostEvent( event ) : false;
}
示例#6
0
/*
==============
sdLimboMenu::HandleGuiEvent
==============
*/
bool sdLimboMenu::HandleGuiEvent( const sdSysEvent* event ) {
	sdUserInterfaceLocal* ui = GetGui();
	bool retVal = ui ? ui->PostEvent( event ) : false;

	if( !retVal ) {
		retVal = sdHudModule::HandleGuiEvent( event );
	}

	return retVal;  

}
示例#7
0
IntPtr GuiEnv_AddStaticTextW(IntPtr guienv, wchar_t* text, M_RECT rectangle, bool border, bool wordWrap, IntPtr parent, int id, bool fillBack)
{
	return GetGui(guienv)->addStaticText((text), MU_RECT(rectangle), border, wordWrap, (IGUIElement*)parent, id, fillBack);
}
//----------------------------------------------------------------------------
void medPipeComputeWrapping::UpdateProperty(bool fromTag)
//----------------------------------------------------------------------------
{
    if (!m_DataMapper)
        return;


    if (!m_DataActor)
        return;

    if (!m_Caption)
        return;


    vtkPolyData *data =vtkPolyData::SafeDownCast(m_WrappedMeterVME->GetWrappedMeterOutput()->GetVTKData());
    data->Update();
    if (m_WrappedMeterVME->GetMeterRepresentation() == medVMEComputeWrapping::LINE_REPRESENTATION)
        m_DataMapper->SetInput(data);
    else
    {
        m_Tube->Update();
        m_DataMapper->SetInput(m_Tube->GetOutput());
    }

    double distance_value = m_WrappedMeterVME->GetDistance();
// if(m_WrappedMeterVME->GetMeterMode() == medVMEComputeWrapping::LINE_ANGLE) distance_value = m_WrappedMeterVME->GetAngle();
    distance_value = RoundValue(distance_value);
    wxString dis;
    dis = wxString::Format("%.2f",distance_value);
    m_Caption->SetCaption(dis.c_str());
    m_Caption->SetVisibility(m_WrappedMeterVME->GetMeterAttributes()->m_LabelVisibility);

    double rgb[3];
    double v = m_WrappedMeterVME->GetDistance();
    int color_mode = m_WrappedMeterVME->GetMeterColorMode();
    if(color_mode == medVMEComputeWrapping::RANGE_COLOR)
    {
        double *range;
        m_DataMapper->SetLookupTable(m_Lut);
        range = m_WrappedMeterVME->GetDistanceRange();
        m_Lut->SetTableRange(range[0],range[1]);
        m_Lut->Build();
        m_Lut->GetColor(v,rgb);
        m_DataActor->GetProperty()->SetColor(rgb);
        m_Caption->GetProperty()->SetColor(rgb);
    }
    else
    {
        m_DataMapper->SetColorModeToDefault();
        m_DataActor->GetProperty()->SetColor(m_WrappedMeterVME->GetMaterial()->m_Diffuse);
        m_Caption->GetProperty()->SetColor(m_WrappedMeterVME->GetMaterial()->m_Diffuse);
    }

    double pos[3] = {0,0,0};
    double rot[3] = {0,0,0};
    mafVME *linked_vme = m_WrappedMeterVME->GetStartVME();
    mafSmartPointer<mafTransform> TmpTransform;
    if(linked_vme && linked_vme->IsMAFType(mafVMELandmarkCloud) && m_WrappedMeterVME->GetLinkSubId("StartVME") != -1)
    {
        ((mafVMELandmarkCloud *)linked_vme)->GetLandmark(m_WrappedMeterVME->GetLinkSubId("StartVME"),pos,-1);
        TmpTransform->SetMatrix(*linked_vme->GetOutput()->GetAbsMatrix());
        TmpTransform->TransformPoint(pos,pos);
    }
    else if(linked_vme)
    {
        linked_vme->GetOutput()->GetAbsPose(pos,rot);
    }
    m_Caption->SetAttachmentPoint(pos[0],pos[1],pos[2]);

    GetGui()->Update();

    m_SelectionBox->SetInput(data);
    m_SelectionBox->Update();

    /*
    if(fromTag)
    {
    	((mafVmeData *)m_Vme->GetClientData())->UpdateFromTag();
      int idx = m_Vme->GetTagArray()->FindTag("VME_CENTER_ROTATION_POSE");
      vtkTagItem *item = NULL;
      double vec[16];
      if (idx != -1)
      {
        item = m_Vme->GetTagArray()->GetTag(idx);
        mflSmartPointer<vtkMatrix4x4> pose;
        for (int el=0;el<16;el++)
        {
          vec[el] = item->GetValueAsDouble(el);
        }
        pose->DeepCopy(vec);
        m_axes->SetPose(pose);
      }
      else
        m_axes->SetPose();
    }
    else
      m_DataMapper->SetScalarVisibility(((mafVmeData *)m_Vme->GetClientData())->GetColorByScalar());
    */
}
示例#9
0
IntPtr GuiEnv_AddMessageBoxW(IntPtr guienv, wchar_t* caption, wchar_t* text, bool modal, EMESSAGE_BOX_FLAG flags, IntPtr parent, int id)
{
	return GetGui(guienv)->addMessageBox((caption), (text), modal, flags, (IGUIElement*)parent, id);
}
示例#10
0
IntPtr GuiEnv_AddImageAW(IntPtr guienv, IntPtr image, M_POS2DS pos, bool useAlphaChannel, IntPtr parent, int id, wchar_t* text)
{
	return GetGui(guienv)->addImage((ITexture*)image, MU_POS2DS(pos), useAlphaChannel, (IGUIElement*)parent, id, (text));
}
示例#11
0
IntPtr GuiEnv_AddListBox(IntPtr guienv, M_RECT rectangle, IntPtr parent, int id, bool drawBackground)
{
	return GetGui(guienv)->addListBox(MU_RECT(rectangle), (IGUIElement*)parent, id, drawBackground);
}
示例#12
0
IntPtr GuiEnv_AddCheckBoxW(IntPtr guienv, bool checked, M_RECT rectangle, IntPtr parent, int id, wchar_t* text)
{
	return GetGui(guienv)->addCheckBox(checked, MU_RECT(rectangle), (IGUIElement*)parent, id, (text));
}
示例#13
0
IntPtr GuiEnv_AddFileOpenDialogW(IntPtr guienv, wchar_t* title, bool model, IntPtr parent, int id)
{
	return GetGui(guienv)->addFileOpenDialog((title), model, (IGUIElement*)parent, id);
}
示例#14
0
IntPtr GuiEnv_AddToolBar(IntPtr guienv, IntPtr parent, int id)
{
	return GetGui(guienv)->addToolBar((IGUIElement*)parent, id);
}
示例#15
0
IntPtr GuiEnv_AddFileOpenDialog(IntPtr guienv, M_STRING title, bool model, IntPtr parent, int id)
{
	return GetGui(guienv)->addFileOpenDialog(MU_WCHAR(title), model, (IGUIElement*)parent, id);
}
示例#16
0
IntPtr GuiEnv_AddTab(IntPtr guienv, M_RECT rectangle, IntPtr parent, int id)
{
	return GetGui(guienv)->addTab(MU_RECT(rectangle), (IGUIElement*)parent, id);
}
示例#17
0
IntPtr GuiEnv_AddTabControl(IntPtr guienv, M_RECT rectangle, IntPtr parent, bool fillbackGround, bool border, int id)
{
	return GetGui(guienv)->addTabControl(MU_RECT(rectangle), (IGUIElement*)parent, fillbackGround, border, id);
}
示例#18
0
IntPtr GuiEnv_AddScrollBar(IntPtr guienv, bool horizontal, M_RECT rectangle, IntPtr parent, int id)
{
	return GetGui(guienv)->addScrollBar(horizontal, MU_RECT(rectangle), (IGUIElement*)parent, id);
}
示例#19
0
IntPtr GuiEnv_AddMessageBox(IntPtr guienv, M_STRING caption, M_STRING text, bool modal, EMESSAGE_BOX_FLAG flags, IntPtr parent, int id)
{
	return GetGui(guienv)->addMessageBox(MU_WCHAR(caption), MU_WCHAR(text), modal, flags, (IGUIElement*)parent, id);
}
示例#20
0
IntPtr GuiEnv_AddButton(IntPtr guienv, M_RECT rectangle, IntPtr parent, int id, M_STRING text)
{
	return GetGui(guienv)->addButton(MU_RECT(rectangle), (IGUIElement*)parent, id, MU_WCHAR(text));
}
示例#21
0
IntPtr GuiEnv_AddWindowW(IntPtr guienv, M_RECT rectangle, bool modal, wchar_t* text, IntPtr parent, int id)
{
	return GetGui(guienv)->addWindow(MU_RECT(rectangle), modal, (text), (IGUIElement*)parent, id);
}
示例#22
0
void GuiEnv_SetFocus(IntPtr guienv, IntPtr element)
{
	GetGui(guienv)->setFocus((IGUIElement*)element);
}
示例#23
0
IntPtr GuiEnv_AddColorSelectDialogW(IntPtr guienv, wchar_t* title, bool modal, IntPtr parent, int id)
{
	return GetGui(guienv)->addColorSelectDialog ((title), modal, (IGUIElement*)parent, id);
}
示例#24
0
IntPtr GuiEnv_AddEditBox(IntPtr guienv, M_STRING text, M_RECT rectangle, bool border, IntPtr parent, int id)
{
	return GetGui(guienv)->addEditBox(MU_WCHAR(text), MU_RECT(rectangle), border, (IGUIElement*)parent, id);
}
示例#25
0
IntPtr GuiEnv_AddEditBoxW(IntPtr guienv, wchar_t* text, M_RECT rectangle, bool border, IntPtr parent, int id)
{
	return GetGui(guienv)->addEditBox((text), MU_RECT(rectangle), border, (IGUIElement*)parent, id);
}
示例#26
0
/*
============
sdHudModule::Draw
============
*/
void sdHudModule::Draw( void ) {
	sdUserInterfaceLocal* ui = GetGui();
	if ( ui ) {
		ui->Draw();
	}
}
示例#27
0
IntPtr GuiEnv_AddImageW(IntPtr guienv, M_RECT rectangle, IntPtr parent, int id, wchar_t* text)
{
	return GetGui(guienv)->addImage(MU_RECT(rectangle), (IGUIElement*)parent, id, (text));
}
示例#28
0
void GuiEnv_SetSkin(IntPtr guienv, IntPtr skin)
{
	GetGui(guienv)->setSkin((IGUISkin*) skin);
}
示例#29
0
void GuiEnv_RemoveFocus(IntPtr guienv, IntPtr element)
{
	GetGui(guienv)->removeFocus((IGUIElement*)element);
}
示例#30
0
IntPtr GuiEnv_GetBuiltInFont(IntPtr guienv)
{
 return GetGui(guienv)->getBuiltInFont();
}