From 1ed7bda8772353776f6a2f679318d8dc886d47af Mon Sep 17 00:00:00 2001 From: nsubiron Date: Fri, 15 Dec 2017 18:03:44 +0100 Subject: [PATCH] #2 Remove intersection entrance class --- .../Carla/MapGen/IntersectionEntrance.cpp | 77 ------------------- .../Carla/MapGen/IntersectionEntrance.h | 63 --------------- 2 files changed, 140 deletions(-) delete mode 100644 Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/IntersectionEntrance.cpp delete mode 100644 Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/IntersectionEntrance.h diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/IntersectionEntrance.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/IntersectionEntrance.cpp deleted file mode 100644 index 025b22d2f..000000000 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/IntersectionEntrance.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma -// de Barcelona (UAB), and the INTEL Visual Computing Lab. -// -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#include "Carla.h" -#include "IntersectionEntrance.h" - - -// Sets default values -AIntersectionEntrance::AIntersectionEntrance(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) -{ - // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. - PrimaryActorTick.bCanEverTick = true; -} - -// Called when the game starts or when spawned -void AIntersectionEntrance::BeginPlay() -{ - Super::BeginPlay(); - -} - -// Called every frame -void AIntersectionEntrance::Tick(float DeltaTime) -{ - Super::Tick(DeltaTime); - -} - -TArray AIntersectionEntrance::GetRoute(int it) -{ - TArray points = Routes[it].points; - TArray route; - - for (int i = 0; i < points.Num(); ++i){ - route.Add(points[i]->GetActorLocation()); - } - - return route; -} - -float AIntersectionEntrance::GetProbability(int it) -{ - return Routes[it].probability; -} - -/* -#if WITH_EDITOR - -void AIntersectionEntrance::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) -{ - Super::PostEditChangeProperty(PropertyChangedEvent); - if (PropertyChangedEvent.Property) { - if (bCreateRoutes && (GetWorld() != nullptr)) { - //ClearRoutes(); - for (int i = 0; i < Routes.Num(); ++i){ - for(int e = 0; e < Routes[i].points.Num(); ++e){ - AActor* actor= GetWorld()->SpawnActor();//USphereComponent* createdComp = NewObject(this);//CreateDefaultSubobject(TEXT("Sphere")); - USceneComponent* SphereMesh = NewObject(actor); - SphereMesh->AttachToComponent(RootComponent,FAttachmentTransformRules::KeepWorldTransform); - if(actor) - { - actor->RegisterAllComponents(); - Routes[i].points[e] = actor; - //Routes[i].points[e].position = createdComp->GetRelativeTransform().GetLocation(); - } - } - } - } - } - bCreateRoutes = false; -} -#endif // WITH_EDITOR -*/ - diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/IntersectionEntrance.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/IntersectionEntrance.h deleted file mode 100644 index ca5cdf6bf..000000000 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/MapGen/IntersectionEntrance.h +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma -// de Barcelona (UAB), and the INTEL Visual Computing Lab. -// -// This work is licensed under the terms of the MIT license. -// For a copy, see . - -#pragma once - -#include "GameFramework/Actor.h" -#include "IntersectionEntrance.generated.h" - -USTRUCT(BlueprintType) -struct FRoute { - - GENERATED_BODY() - - UPROPERTY(BlueprintReadWrite, Category=TrafficRoutes, EditAnywhere) - TArray < AActor *> points; - - UPROPERTY(BlueprintReadWrite, Category=TrafficRoutes, EditAnywhere) - float probability = 0.0f; -}; - - -UCLASS(BlueprintType) -class CARLA_API AIntersectionEntrance : public AActor -{ - GENERATED_BODY() - -public: - // Sets default values for this actor's properties - AIntersectionEntrance(const FObjectInitializer& ObjectInitializer); - -protected: - // Called when the game starts or when spawned - virtual void BeginPlay() override; - -public: - // Called every frame - virtual void Tick(float DeltaTime) override; - -protected: - -UFUNCTION(BlueprintCallable, Category="Trigger") - TArray GetRoute(int route); - -UFUNCTION(BlueprintCallable, Category="Trigger") - float GetProbability(int route); -/* -#if WITH_EDITOR - virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override; -#endif // WITH_EDITOR -*/ -public: - - UPROPERTY(Category = "Routes", EditAnywhere) - bool bCreateRoutes = false; - - - UPROPERTY(BlueprintReadWrite, Category=TrafficRoutes, EditAnywhere) - TArray< FRoute > Routes; - -};