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); }
/* ============== 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; }
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; } }
/* ============== sdFireTeamMenu::HandleGuiEvent ============== */ bool sdFireTeamMenu::HandleGuiEvent( const sdSysEvent* event ) { sdUserInterfaceLocal* ui = GetGui(); if( ui && ui->PostEvent( event ) ) { return true; } return sdHudModule::HandleGuiEvent( event ); }
/* ============== sdTakeViewNoteMenu::HandleGuiEvent ============== */ bool sdTakeViewNoteMenu::HandleGuiEvent( const sdSysEvent* event ) { if ( sdHudModule::HandleGuiEvent( event ) ) { return true; } sdUserInterfaceLocal* ui = GetGui(); return ui ? ui->PostEvent( event ) : false; }
/* ============== 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; }
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()); */ }
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); }
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)); }
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); }
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)); }
IntPtr GuiEnv_AddFileOpenDialogW(IntPtr guienv, wchar_t* title, bool model, IntPtr parent, int id) { return GetGui(guienv)->addFileOpenDialog((title), model, (IGUIElement*)parent, id); }
IntPtr GuiEnv_AddToolBar(IntPtr guienv, IntPtr parent, int id) { return GetGui(guienv)->addToolBar((IGUIElement*)parent, id); }
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); }
IntPtr GuiEnv_AddTab(IntPtr guienv, M_RECT rectangle, IntPtr parent, int id) { return GetGui(guienv)->addTab(MU_RECT(rectangle), (IGUIElement*)parent, id); }
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); }
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); }
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); }
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)); }
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); }
void GuiEnv_SetFocus(IntPtr guienv, IntPtr element) { GetGui(guienv)->setFocus((IGUIElement*)element); }
IntPtr GuiEnv_AddColorSelectDialogW(IntPtr guienv, wchar_t* title, bool modal, IntPtr parent, int id) { return GetGui(guienv)->addColorSelectDialog ((title), modal, (IGUIElement*)parent, id); }
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); }
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); }
/* ============ sdHudModule::Draw ============ */ void sdHudModule::Draw( void ) { sdUserInterfaceLocal* ui = GetGui(); if ( ui ) { ui->Draw(); } }
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)); }
void GuiEnv_SetSkin(IntPtr guienv, IntPtr skin) { GetGui(guienv)->setSkin((IGUISkin*) skin); }
void GuiEnv_RemoveFocus(IntPtr guienv, IntPtr element) { GetGui(guienv)->removeFocus((IGUIElement*)element); }
IntPtr GuiEnv_GetBuiltInFont(IntPtr guienv) { return GetGui(guienv)->getBuiltInFont(); }