本文整理汇总了C++中ABrush::Modify方法的典型用法代码示例。如果您正苦于以下问题:C++ ABrush::Modify方法的具体用法?C++ ABrush::Modify怎么用?C++ ABrush::Modify使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ABrush
的用法示例。
在下文中一共展示了ABrush::Modify方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MapSetBrush
void UEditorEngine::MapSetBrush( UWorld* InWorld, EMapSetBrushFlags PropertiesMask, uint16 BrushColor, FName GroupName, uint32 SetPolyFlags, uint32 ClearPolyFlags, uint32 BrushType, int32 DrawType )
{
// Fire ULevel::LevelDirtiedEvent when falling out of scope.
FScopedLevelDirtied LevelDirtyCallback;
for( FStaticBrushIterator It(InWorld); It; ++It )
{
ABrush* Brush = CastChecked<ABrush>(*It);
if( !FActorEditorUtils::IsABuilderBrush(Brush) && Brush->IsSelected() )
{
if( PropertiesMask & MSB_PolyFlags )
{
Brush->Modify();
Brush->PolyFlags = (Brush->PolyFlags & ~ClearPolyFlags) | SetPolyFlags;
Brush->UpdateComponentTransforms();
Brush->MarkPackageDirty();
LevelDirtyCallback.Request();
}
if( PropertiesMask & MSB_BrushType )
{
Brush->Modify();
Brush->BrushType = EBrushType(BrushType);
Brush->UpdateComponentTransforms();
Brush->MarkPackageDirty();
LevelDirtyCallback.Request();
}
}
}
}
示例2: mapBrushPut
void UEditorEngine::mapBrushPut()
{
TArray<FEdMode*> ActiveModes;
GLevelEditorModeTools().GetActiveModes( ActiveModes );
for ( FSelectionIterator It( GEditor->GetSelectedActorIterator() ) ; It ; ++It )
{
AActor* Actor = static_cast<AActor*>( *It );
checkSlow( Actor->IsA(AActor::StaticClass()) );
ABrush* BrushActor = Cast< ABrush >( Actor );
if( BrushActor && !FActorEditorUtils::IsABuilderBrush(Actor) )
{
check( BrushActor->GetWorld() );
ABrush* WorldBrush = BrushActor->GetWorld()->GetDefaultBrush();
check( WorldBrush );
BrushActor->Modify();
BrushActor->Brush->Polys->Element = WorldBrush->Brush->Polys->Element;
BrushActor->CopyPosRotScaleFrom( WorldBrush );
BrushActor->SetNeedRebuild(BrushActor->GetLevel());
WorldBrush->ReregisterAllComponents();
for( int32 ModeIndex = 0; ModeIndex < ActiveModes.Num(); ++ModeIndex )
{
ActiveModes[ModeIndex]->UpdateInternalData();
}
}
}
}
示例3: MapBrushGet
void UEditorEngine::MapBrushGet(UWorld* InWorld)
{
for ( FSelectionIterator It( GEditor->GetSelectedActorIterator() ) ; It ; ++It )
{
AActor* Actor = static_cast<AActor*>( *It );
checkSlow( Actor->IsA(AActor::StaticClass()) );
ABrush* BrushActor = Cast< ABrush >( Actor );
if( BrushActor && !FActorEditorUtils::IsABuilderBrush(Actor) )
{
check( BrushActor->GetWorld() );
ABrush* WorldBrush = BrushActor->GetWorld()->GetDefaultBrush();
check( WorldBrush );
WorldBrush->Modify();
WorldBrush->Brush->Polys->Element = BrushActor->Brush->Polys->Element;
WorldBrush->CopyPosRotScaleFrom( BrushActor );
WorldBrush->ReregisterAllComponents();
break;
}
}
GEditor->SelectNone( false, true );
GEditor->SelectActor(InWorld->GetDefaultBrush(), true, true);
}
示例4: csgRebuild
void UEditorEngine::csgRebuild( UWorld* InWorld )
{
GWarn->BeginSlowTask( NSLOCTEXT("UnrealEd", "RebuildingGeometry", "Rebuilding geometry"), false );
FBSPOps::GFastRebuild = 1;
FinishAllSnaps();
// Empty the model out.
InWorld->GetModel()->Modify();
InWorld->GetModel()->EmptyModel(1, 1);
// Count brushes.
int32 BrushTotal=0, BrushCount=0;
for( FStaticBrushIterator It(InWorld); It; ++It )
{
ABrush* Brush = CastChecked<ABrush>(*It);
if( !FActorEditorUtils::IsABuilderBrush(Brush) )
{
BrushTotal++;
}
}
// Check for the giant cube brush that is created for subtractive levels.
// If it's found, apply the RemoveSurfaceMaterial to its polygons so they aren't lit or drawn.
for(FStaticBrushIterator GiantCubeBrushIt(InWorld);GiantCubeBrushIt;++GiantCubeBrushIt)
{
ABrush* GiantCubeBrush = CastChecked<ABrush>(*GiantCubeBrushIt);
if(GiantCubeBrush->Brush && GiantCubeBrush->Brush->Bounds.SphereRadius > HALF_WORLD_MAX)
{
check(GiantCubeBrush->Brush->Polys);
for(int32 PolyIndex = 0;PolyIndex < GiantCubeBrush->Brush->Polys->Element.Num();PolyIndex++)
{
FPoly& Polygon = GiantCubeBrush->Brush->Polys->Element[PolyIndex];
const float PolygonArea = Polygon.Area();
if(PolygonArea > WORLD_MAX * WORLD_MAX * 0.99f && PolygonArea < WORLD_MAX * WORLD_MAX * 1.01f)
{
Polygon.Material = GEngine->RemoveSurfaceMaterial;
}
}
}
}
// Compose all structural brushes and portals.
for( FStaticBrushIterator It(InWorld); It; ++It )
{
ABrush* Brush = CastChecked<ABrush>(*It);
if( !FActorEditorUtils::IsABuilderBrush(Brush) )
{
if
( !(Brush->PolyFlags&PF_Semisolid)
|| (Brush->BrushType!=Brush_Add)
|| (Brush->PolyFlags&PF_Portal) )
{
// Treat portals as solids for cutting.
if( Brush->PolyFlags & PF_Portal )
{
Brush->PolyFlags = (Brush->PolyFlags & ~PF_Semisolid) | PF_NotSolid;
}
BrushCount++;
FFormatNamedArguments Args;
Args.Add( TEXT("BrushCount"), BrushCount );
Args.Add( TEXT("BrushTotal"), BrushTotal );
GWarn->StatusUpdate( BrushCount, BrushTotal, FText::Format( NSLOCTEXT("UnrealEd", "ApplyingStructuralBrushF", "Applying structural brush {BrushCount} of {BrushTotal}"), Args ) );
Brush->Modify();
bspBrushCSG( Brush, InWorld->GetModel(), Brush->PolyFlags, (EBrushType)Brush->BrushType, CSG_None, false, true, false );
}
}
}
// Repartition the structural BSP.
{
GWarn->StatusUpdate( 0, 4, NSLOCTEXT("UnrealEd", "RebuildBSPBuildingPolygons", "Rebuild BSP: Building polygons") );
bspBuildFPolys( InWorld->GetModel(), 1, 0 );
GWarn->StatusUpdate( 1, 4, NSLOCTEXT("UnrealEd", "RebuildBSPMergingPlanars", "Rebuild BSP: Merging planars") );
bspMergeCoplanars( InWorld->GetModel(), 0, 0 );
GWarn->StatusUpdate( 2, 4, NSLOCTEXT("UnrealEd", "RebuildBSPPartitioning", "Rebuild BSP: Partitioning") );
FBSPOps::bspBuild( InWorld->GetModel(), FBSPOps::BSP_Optimal, 15, 70, 0, 0 );
GWarn->UpdateProgress( 4, 4 );
}
// Remember leaves.
TArray<int32> iFronts, iBacks;
if( InWorld->GetModel()->Nodes.Num() )
{
EnlistLeaves( InWorld->GetModel(), iFronts, iBacks, 0 );
}
// Compose all detail brushes.
for( FStaticBrushIterator It(InWorld); It; ++It )
{
ABrush* Brush = CastChecked<ABrush>(*It);
if
( !FActorEditorUtils::IsABuilderBrush(Brush)
&& (Brush->PolyFlags&PF_Semisolid)
&& !(Brush->PolyFlags&PF_Portal)
//.........这里部分代码省略.........