當前位置: 首頁>>代碼示例>>C++>>正文


C++ GLevelEditorModeTools函數代碼示例

本文整理匯總了C++中GLevelEditorModeTools函數的典型用法代碼示例。如果您正苦於以下問題:C++ GLevelEditorModeTools函數的具體用法?C++ GLevelEditorModeTools怎麽用?C++ GLevelEditorModeTools使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GLevelEditorModeTools函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: FrustumSelect

/** @return		true if something was selected/deselected, false otherwise. */
bool FModeTool_GeometryModify::FrustumSelect( const FConvexVolume& InFrustum, bool InSelect /* = true */ )
{
	bool bResult = false;
	if( GLevelEditorModeTools().IsModeActive( FBuiltinEditorModes::EM_Geometry ) )
	{
		FEdModeGeometry* mode = (FEdModeGeometry*)GLevelEditorModeTools().GetActiveMode( FBuiltinEditorModes::EM_Geometry );

		for( FEdModeGeometry::TGeomObjectIterator Itor( mode->GeomObjectItor() ) ; Itor ; ++Itor )
		{
			FGeomObjectPtr go = *Itor;
			FTransform ActorToWorld = go->GetActualBrush()->ActorToWorld();
			// Check each vertex to see if its inside the frustum
			for( int32 v = 0 ; v < go->VertexPool.Num() ; ++v )
			{
				FGeomVertex& gv = go->VertexPool[v];
				if( InFrustum.IntersectBox( ActorToWorld.TransformPosition( gv.GetMid() ), FVector::ZeroVector ) )
				{
					gv.Select( InSelect );
					bResult = true;
				}
			}
		}
	}
	return bResult;
}
開發者ID:PickUpSU,項目名稱:UnrealEngine4,代碼行數:26,代碼來源:GeometryEdMode.cpp

示例2: BoxSelect

/** @return		true if something was selected/deselected, false otherwise. */
bool FModeTool_GeometryModify::BoxSelect( FBox& InBox, bool InSelect )
{
	bool bResult = false;
	if( GLevelEditorModeTools().IsModeActive( FBuiltinEditorModes::EM_Geometry ) )
	{
		FEdModeGeometry* mode = (FEdModeGeometry*)GLevelEditorModeTools().GetActiveMode( FBuiltinEditorModes::EM_Geometry );

		for( FEdModeGeometry::TGeomObjectIterator Itor( mode->GeomObjectItor() ) ; Itor ; ++Itor )
		{
			FGeomObjectPtr go = *Itor;
			FTransform ActorToWorld = go->GetActualBrush()->ActorToWorld();

			// Only verts for box selection

			for( int32 v = 0 ; v < go->VertexPool.Num() ; ++v )
			{
				FGeomVertex& gv = go->VertexPool[v];
				if( FMath::PointBoxIntersection( ActorToWorld.TransformPosition( gv.GetMid() ), InBox ) )
				{
					gv.Select( InSelect );
					bResult = true;
				}
			}
		}
	}
	return bResult;
}
開發者ID:PickUpSU,項目名稱:UnrealEngine4,代碼行數:28,代碼來源:GeometryEdMode.cpp

示例3: EditorExit

void EditorExit()
{
	GLevelEditorModeTools().SetDefaultMode(FBuiltinEditorModes::EM_Default);
	GLevelEditorModeTools().DeactivateAllModes(); // this also activates the default mode

	// Save out any config settings for the editor so they don't get lost
	GEditor->SaveConfig();
	GLevelEditorModeTools().SaveConfig();

	// Clean up the actor folders singleton
	FActorFolders::Cleanup();

	// Save out default file directories
	FEditorDirectories::Get().SaveLastDirectories();

	// Allow the game thread to finish processing any latent tasks.
	// Some editor functions may queue tasks that need to be run before the editor is finished.
	FTaskGraphInterface::Get().ProcessThreadUntilIdle(ENamedThreads::GameThread);

	// Cleanup the misc editor
	FUnrealEdMisc::Get().OnExit();

	if( GLogConsole )
	{
		GLogConsole->Show( false );
	}

	delete GDebugToolExec;
	GDebugToolExec = NULL;
}
開發者ID:zhaoyizheng0930,項目名稱:UnrealEngine,代碼行數:30,代碼來源:UnrealEd.cpp

示例4: GLevelEditorModeTools

void SLevelEditorModeContent::HandleParentClosed( TSharedRef<SDockTab> TabBeingClosed )
{
	if ( GLevelEditorModeTools().IsModeActive(EditorMode->GetID()) )
	{
		GLevelEditorModeTools().DeactivateMode(EditorMode->GetID());
	}
}
開發者ID:Codermay,項目名稱:Unreal4,代碼行數:7,代碼來源:SLevelEditorModeContent.cpp

示例5: check

bool FModeTool_InterpEdit::InputDelta(FEditorViewportClient* InViewportClient, FViewport* InViewport, FVector& InDrag, FRotator& InRot, FVector& InScale)
{
	check( GLevelEditorModeTools().IsModeActive(FBuiltinEditorModes::EM_InterpEdit) );

	FEdModeInterpEdit* mode = (FEdModeInterpEdit*)GLevelEditorModeTools().GetActiveMode(FBuiltinEditorModes::EM_InterpEdit);
	check(mode->InterpEd);

	bool bShiftDown = InViewport->KeyState(EKeys::LeftShift) || InViewport->KeyState(EKeys::RightShift);

	FVector InputDeltaDrag( InDrag );

	// If we are grabbing a 'handle' on the movement curve, pass that info to Matinee
	if(bMovingHandle)
	{
		mode->InterpEd->Move3DHandle( DragGroup, DragTrackIndex, DragKeyIndex, bDragArriving, InputDeltaDrag * (1.f/CurveHandleScale) );

		return 1;
	}
	// If shift is downOnly do 'move initial position' if dragging the widget
	else if(bShiftDown && InViewportClient->GetCurrentWidgetAxis() != EAxisList::None)
	{
		mode->InterpEd->MoveInitialPosition( InputDeltaDrag, InRot );

		return 1;
	}

	InViewportClient->Viewport->Invalidate();

	return 0;
}
開發者ID:Codermay,項目名稱:Unreal4,代碼行數:30,代碼來源:EditorModeInterpolation.cpp

示例6: GLevelEditorModeTools

bool FCreateLandscapeCommand::Update()
{
	//Switch to the Landscape tool
	GLevelEditorModeTools().ActivateMode(FBuiltinEditorModes::EM_Landscape);
	FEdModeLandscape* LandscapeEdMode = (FEdModeLandscape*)GLevelEditorModeTools().GetActiveMode(FBuiltinEditorModes::EM_Landscape);

	//Modify the "Section size"
	LandscapeEdMode->UISettings->NewLandscape_QuadsPerSection = 7;
	LandscapeEdMode->UISettings->NewLandscape_ClampSize();

	//Create the landscape
	TSharedPtr<FLandscapeEditorDetailCustomization_NewLandscape> Customization_NewLandscape = MakeShareable(new FLandscapeEditorDetailCustomization_NewLandscape);
	Customization_NewLandscape->OnCreateButtonClicked();

	if (LandscapeEdMode->CurrentToolTarget.LandscapeInfo.IsValid())
	{
		UE_LOG(LogLandscapeAutomationTests, Display, TEXT("Created a new landscape"));
	}
	else
	{
		UE_LOG(LogLandscapeAutomationTests, Error, TEXT("Failed to create a new landscape"));
	}

	return true;
}
開發者ID:johndpope,項目名稱:UE4,代碼行數:25,代碼來源:LandscapeAutomationTests.cpp

示例7: SAssignNew

void SToolkitDisplay::Construct( const FArguments& InArgs, const TSharedRef< class ILevelEditor >& OwningLevelEditor )
{
	OnInlineContentChangedDelegate = InArgs._OnInlineContentChanged;

	ChildSlot
		[
			SAssignNew( VBox, SVerticalBox )
		];

	// Register with the mode system to find out when a mode is entered or exited
	GLevelEditorModeTools().OnEditorModeChanged().AddSP( SharedThis( this ), &SToolkitDisplay::OnEditorModeChanged );

	// Find all of the current active modes and toolkits and add those right away.  This widget could have been created "late"!
	{
		TArray< FEdMode* > ActiveModes;
		GLevelEditorModeTools().GetActiveModes( ActiveModes );
		for( auto EdModeIt = ActiveModes.CreateConstIterator(); EdModeIt; ++EdModeIt )
		{
			// We don't care about the default editor mode.  Just ignore it.
			if( (*EdModeIt)->GetID() != FBuiltinEditorModes::EM_Default && !(*EdModeIt)->UsesToolkits() )
			{
				AddEditorMode( *EdModeIt );
			}
		}

		const TArray< TSharedPtr< IToolkit > >& HostedToolkits = OwningLevelEditor->GetHostedToolkits();
		for( auto HostedToolkitIt = HostedToolkits.CreateConstIterator(); HostedToolkitIt; ++HostedToolkitIt )
		{
			OnToolkitHostingStarted( ( *HostedToolkitIt ).ToSharedRef() );
		}
	}
}
開發者ID:1vanK,項目名稱:AHRUnrealEngine,代碼行數:32,代碼來源:SToolkitDisplay.cpp

示例8: EditorExit

void EditorExit()
{
	GLevelEditorModeTools().SetDefaultMode(FBuiltinEditorModes::EM_Default);
	GLevelEditorModeTools().DeactivateAllModes(); // this also activates the default mode

	// Save out any config settings for the editor so they don't get lost
	GEditor->SaveConfig();
	GLevelEditorModeTools().SaveConfig();

	// Clean up the actor folders singleton
	FActorFolders::Cleanup();

	// Save out default file directories
	FEditorDirectories::Get().SaveLastDirectories();

	// Cleanup the misc editor
	FUnrealEdMisc::Get().OnExit();

	if( GLogConsole )
	{
		GLogConsole->Show( false );
	}


	delete GDebugToolExec;
	GDebugToolExec = NULL;

}
開發者ID:1vanK,項目名稱:AHRUnrealEngine,代碼行數:28,代碼來源:UnrealEd.cpp

示例9: check

const FGeomObjectPtr FGeomBase::GetParentObject() const
{
	check( GLevelEditorModeTools().IsModeActive(FBuiltinEditorModes::EM_Geometry) );
	check( ParentObjectIndex > INDEX_NONE );

	const FEdModeGeometry* mode = (FEdModeGeometry*)GLevelEditorModeTools().GetActiveMode(FBuiltinEditorModes::EM_Geometry);
	return mode->GetGeomObject( ParentObjectIndex );
}
開發者ID:PickUpSU,項目名稱:UnrealEngine4,代碼行數:8,代碼來源:EditorGeometry.cpp

示例10: GLevelEditorModeTools

void FEdModeTexture::Enter()
{
	FEdMode::Enter();

	const bool bGetRawValue = true;
	SaveCoordSystem = GLevelEditorModeTools().GetCoordSystem(bGetRawValue);
	GLevelEditorModeTools().SetCoordSystem(COORD_Local);
}
開發者ID:RandomDeveloperM,項目名稱:UE4_Hairworks,代碼行數:8,代碼來源:TextureAlignEdMode.cpp

示例11: GetLevelObjectList

void FLevelCollectionModel::UnloadLevels(const FLevelModelList& InLevelList)
{
	if (InLevelList.Num() == 0)
	{
		return;
	}

	// If matinee is opened, and if it belongs to the level being removed, close it
	if (GLevelEditorModeTools().IsModeActive(FBuiltinEditorModes::EM_InterpEdit))
	{
		TArray<ULevel*> LevelsToRemove = GetLevelObjectList(InLevelList);
		
		const FEdModeInterpEdit* InterpEditMode = (const FEdModeInterpEdit*)GLevelEditorModeTools().GetActiveMode(FBuiltinEditorModes::EM_InterpEdit);

		if (InterpEditMode && InterpEditMode->MatineeActor && LevelsToRemove.Contains(InterpEditMode->MatineeActor->GetLevel()))
		{
			GLevelEditorModeTools().ActivateDefaultMode();
		}
	}
	else if(GLevelEditorModeTools().IsModeActive(FBuiltinEditorModes::EM_Landscape))
	{
		GLevelEditorModeTools().ActivateDefaultMode();
	}

	
	// Remove each level!
	// Take a copy of the list rather than using a reference to the selected levels list, as this will be modified in the loop below
	const FLevelModelList LevelListCopy = InLevelList;
	for (auto It = LevelListCopy.CreateConstIterator(); It; ++It)
	{
		TSharedPtr<FLevelModel> LevelModel = (*It);
		ULevel* Level = LevelModel->GetLevelObject();

		if (Level != NULL && !LevelModel->IsPersistent())
		{
			// Unselect all actors before removing the level
			// This avoids crashing in areas that rely on getting a selected actors level. The level will be invalid after its removed.
			for (auto ActorIt = Level->Actors.CreateIterator(); ActorIt; ++ActorIt)
			{
				Editor->SelectActor((*ActorIt), /*bInSelected=*/ false, /*bSelectEvenIfHidden=*/ false);
			}
			
			{
				FUnmodifiableObject ImmuneWorld(CurrentWorld.Get());
				EditorLevelUtils::RemoveLevelFromWorld(Level);
			}
		}
	}

	Editor->ResetTransaction( LOCTEXT("RemoveLevelTransReset", "Removing Levels from World") );

	// Collect garbage to clear out the destroyed level
	CollectGarbage( GARBAGE_COLLECTION_KEEPFLAGS );

	PopulateLevelsList();
}
開發者ID:Foreven,項目名稱:Unreal4-1,代碼行數:56,代碼來源:LevelCollectionModel.cpp

示例12: GLevelEditorModeTools

bool ALandscapePlaceholder::TeleportTo(const FVector& DestLocation, const FRotator& DestRotation, bool bIsATest /*= false*/, bool bNoCheck /*= false*/)
{
	bool bResult = Super::TeleportTo(DestLocation, DestRotation, bIsATest, bNoCheck);

	GLevelEditorModeTools().ActivateMode(FBuiltinEditorModes::EM_Landscape);

	FEdModeLandscape* EdMode = (FEdModeLandscape*)GLevelEditorModeTools().GetActiveMode(FBuiltinEditorModes::EM_Landscape);

	EdMode->UISettings->NewLandscape_Location = GetActorLocation();
	EdMode->UISettings->NewLandscape_Rotation = GetActorRotation();

	EdMode->SetCurrentTool("NewLandscape");

	return bResult;
}
開發者ID:Codermay,項目名稱:Unreal4,代碼行數:15,代碼來源:ActorFactoryLandscape.cpp

示例13: GLevelEditorModeTools

void UVREditorMode::CycleTransformGizmoHandleType()
{
	EGizmoHandleTypes NewGizmoType = (EGizmoHandleTypes)( (uint8)WorldInteraction->GetCurrentGizmoType() + 1 );
	
	if( NewGizmoType > EGizmoHandleTypes::Scale )
	{
		NewGizmoType = EGizmoHandleTypes::All;
	}

	// Set coordinate system to local if the next gizmo will be for non-uniform scaling 
	if ( NewGizmoType == EGizmoHandleTypes::Scale )
	{
		const ECoordSystem CurrentCoordSystem = WorldInteraction->GetTransformGizmoCoordinateSpace();
		if ( CurrentCoordSystem == COORD_World )
		{
			GLevelEditorModeTools().SetCoordSystem( COORD_Local );
			// Remember if coordinate system was in world space before scaling
			bWasInWorldSpaceBeforeScaleMode = true;
		}
		else if ( CurrentCoordSystem == COORD_Local )
		{
			bWasInWorldSpaceBeforeScaleMode = false;
		}
	} 
	else if ( WorldInteraction->GetCurrentGizmoType() == EGizmoHandleTypes::Scale && bWasInWorldSpaceBeforeScaleMode )
	{
		// Set the coordinate system to world space if the coordinate system was world before scaling
		WorldInteraction->SetTransformGizmoCoordinateSpace( COORD_World );
	}
	
	WorldInteraction->SetGizmoHandleType( NewGizmoType );
}
開發者ID:zhaoyizheng0930,項目名稱:UnrealEngine,代碼行數:32,代碼來源:VREditorMode.cpp

示例14: UpdatePivotLocationForSelection

void UUnrealEdEngine::NoteSelectionChange()
{
	// The selection changed, so make sure the pivot (widget) is located in the right place
	UpdatePivotLocationForSelection( true );

	// Clear active editing visualizer on selection change
	GUnrealEd->ComponentVisManager.ClearActiveComponentVis();

	TArray<FEdMode*> ActiveModes;
	GLevelEditorModeTools().GetActiveModes( ActiveModes );
	for( int32 ModeIndex = 0; ModeIndex < ActiveModes.Num(); ++ModeIndex )
	{
		ActiveModes[ModeIndex]->ActorSelectionChangeNotify();
	}

	const bool bComponentSelectionChanged = GetSelectedComponentCount() > 0;
	USelection* Selection = bComponentSelectionChanged ? GetSelectedComponents() : GetSelectedActors();
	USelection::SelectionChangedEvent.Broadcast(Selection);
	
	if (!bComponentSelectionChanged)
	{
		//whenever selection changes, recompute whether the selection contains a locked actor
		bCheckForLockActors = true;

		//whenever selection changes, recompute whether the selection contains a world info actor
		bCheckForWorldSettingsActors = true;

		UpdateFloatingPropertyWindows();
	}

	RedrawLevelEditingViewports();
}
開發者ID:didixp,項目名稱:Ark-Dev-Kit,代碼行數:32,代碼來源:EditorSelectUtils.cpp

示例15: PreCreateTrack

bool UMatineeTrackVectorPropHelper::PreCreateTrack( UInterpGroup* Group, const UInterpTrack *TrackDef, bool bDuplicatingTrack, bool bAllowPrompts ) const
{
	bool bResult = true;

	if( bAllowPrompts && bDuplicatingTrack == false )
	{
		bResult = false;

		// For Property tracks - pop up a dialog to choose property name.
		TrackAddPropName = NAME_None;

		FEdModeInterpEdit* Mode = (FEdModeInterpEdit*)GLevelEditorModeTools().GetActiveMode( FBuiltinEditorModes::EM_InterpEdit );
		check(Mode != NULL);

		IMatineeBase* InterpEd = Mode->InterpEd;
		check(InterpEd != NULL);

		UInterpGroupInst* GrInst = InterpEd->GetMatineeActor()->FindFirstGroupInst(Group);
		check(GrInst);

		AActor* Actor = GrInst->GetGroupActor();
		if ( Actor != NULL )
		{
			TArray<FName> PropNames;
			FMatineeUtils::GetInterpVectorPropertyNames(Actor, PropNames);
			bResult = ChooseProperty(PropNames);
		}
	}

	return bResult;
}
開發者ID:zhaoyizheng0930,項目名稱:UnrealEngine,代碼行數:31,代碼來源:MatineeTrackHelpers.cpp


注:本文中的GLevelEditorModeTools函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。