CARLA
Classes | Public Member Functions | Public Attributes | List of all members
carla::geom::MeshFactory Class Reference

Mesh helper generator. More...

#include <MeshFactory.h>

+ Collaboration diagram for carla::geom::MeshFactory:

Classes

struct  RoadParameters
 Parameters for the road generation. More...
 

Public Member Functions

std::unique_ptr< MeshGenerate (const road::Road &road) const
 Generates a mesh that defines a road. More...
 
std::unique_ptr< MeshGenerate (const road::LaneSection &lane_section) const
 Generates a mesh that defines a lane section. More...
 
std::unique_ptr< MeshGenerate (const road::Lane &lane, const double s_start, const double s_end) const
 Generates a mesh that defines a lane from a given s start and end. More...
 
std::unique_ptr< MeshGenerate (const road::Lane &lane) const
 Generates a mesh that defines the whole lane. More...
 
void GenerateAllOrderedWithMaxLen (const road::Road &road, std::map< road::Lane::LaneType, std::vector< std::unique_ptr< Mesh >>> &roads) const
 
std::vector< std::unique_ptr< Mesh > > GenerateAllWithMaxLen (const road::Road &road) const
 Generates a chunked road with all the features needed for simulation. More...
 
void GenerateLaneMarkForRoad (const road::Road &road, std::vector< std::unique_ptr< Mesh >> &inout, std::vector< std::string > &outinfo) const
 
void GenerateLaneMarksForCenterLine (const road::Road &road, const road::LaneSection &lane_section, const road::Lane &lane, std::vector< std::unique_ptr< Mesh >> &inout, std::vector< std::string > &outinfo) const
 
void GenerateLaneMarksForNotCenterLine (const road::LaneSection &lane_section, const road::Lane &lane, std::vector< std::unique_ptr< Mesh >> &inout, std::vector< std::string > &outinfo) const
 
void GenerateLaneSectionOrdered (const road::LaneSection &lane_section, std::map< carla::road::Lane::LaneType, std::vector< std::unique_ptr< Mesh >>> &result) const
 Generates a mesh that defines a lane section. More...
 
std::unique_ptr< MeshGenerateLeftWall (const road::Lane &lane, const double s_start, const double s_end) const
 Generates a wall-like mesh at the left side of the lane. More...
 
std::map< carla::road::Lane::LaneType, std::vector< std::unique_ptr< Mesh > > > GenerateOrderedWithMaxLen (const road::Road &road) const
 Generates a list of meshes that defines a road with a maximum length. More...
 
std::map< carla::road::Lane::LaneType, std::vector< std::unique_ptr< Mesh > > > GenerateOrderedWithMaxLen (const road::LaneSection &lane_section) const
 Generates a list of meshes that defines a lane_section with a maximum length. More...
 
std::unique_ptr< MeshGenerateRightWall (const road::Lane &lane, const double s_start, const double s_end) const
 Generates a wall-like mesh at the right side of the lane. More...
 
std::unique_ptr< MeshGenerateSidewalk (const road::LaneSection &lane_section) const
 
std::unique_ptr< MeshGenerateSidewalk (const road::Lane &lane) const
 
std::unique_ptr< MeshGenerateSidewalk (const road::Lane &lane, const double s_start, const double s_end) const
 
std::unique_ptr< MeshGenerateTesselated (const road::Lane &lane, const double s_start, const double s_end) const
 Generates a mesh that defines a lane from a given s start and end with bigger tesselation. More...
 
std::unique_ptr< MeshGenerateTesselated (const road::Lane &lane) const
 Generates a mesh that defines the whole lane with bigger tesselation. More...
 
std::unique_ptr< MeshGenerateWalls (const road::LaneSection &lane_section) const
 Genrates a mesh representing a wall on the road corners to avoid cars falling down. More...
 
std::vector< std::unique_ptr< Mesh > > GenerateWallsWithMaxLen (const road::Road &road) const
 Generates a list of meshes that defines a road safety wall with a maximum length. More...
 
std::vector< std::unique_ptr< Mesh > > GenerateWallsWithMaxLen (const road::LaneSection &lane_section) const
 Generates a list of meshes that defines a lane_section safety wall with a maximum length. More...
 
std::vector< std::unique_ptr< Mesh > > GenerateWithMaxLen (const road::Road &road) const
 Generates a list of meshes that defines a road with a maximum length. More...
 
std::vector< std::unique_ptr< Mesh > > GenerateWithMaxLen (const road::LaneSection &lane_section) const
 Generates a list of meshes that defines a lane_section with a maximum length. More...
 
std::unique_ptr< MeshMergeAndSmooth (std::vector< std::unique_ptr< Mesh >> &lane_meshes) const
 
 MeshFactory (rpc::OpendriveGenerationParameters params=rpc::OpendriveGenerationParameters())
 

Public Attributes

RoadParameters road_param
 

Detailed Description

Mesh helper generator.

Definition at line 22 of file MeshFactory.h.

Constructor & Destructor Documentation

◆ MeshFactory()

carla::geom::MeshFactory::MeshFactory ( rpc::OpendriveGenerationParameters  params = rpc::OpendriveGenerationParameters())

Member Function Documentation

◆ Generate() [1/4]

std::unique_ptr< Mesh > carla::geom::MeshFactory::Generate ( const road::Road road) const

Generates a mesh that defines a road.

Definition at line 34 of file MeshFactory.cpp.

References carla::road::Road::GetLaneSections().

Referenced by Generate(), carla::road::Map::GenerateChunkedMesh(), carla::road::Map::GenerateMesh(), and GenerateWithMaxLen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Generate() [2/4]

std::unique_ptr< Mesh > carla::geom::MeshFactory::Generate ( const road::LaneSection lane_section) const

Generates a mesh that defines a lane section.

Definition at line 42 of file MeshFactory.cpp.

References Generate(), and carla::road::LaneSection::GetLanes().

+ Here is the call graph for this function:

◆ Generate() [3/4]

std::unique_ptr< Mesh > carla::geom::MeshFactory::Generate ( const road::Lane lane,
const double  s_start,
const double  s_end 
) const

◆ Generate() [4/4]

std::unique_ptr< Mesh > carla::geom::MeshFactory::Generate ( const road::Lane lane) const

Generates a mesh that defines the whole lane.

Definition at line 50 of file MeshFactory.cpp.

References carla::geom::EPSILON, Generate(), carla::road::Lane::GetDistance(), and carla::road::Lane::GetLength().

+ Here is the call graph for this function:

◆ GenerateAllOrderedWithMaxLen()

void carla::geom::MeshFactory::GenerateAllOrderedWithMaxLen ( const road::Road road,
std::map< road::Lane::LaneType, std::vector< std::unique_ptr< Mesh >>> &  roads 
) const

Definition at line 705 of file MeshFactory.cpp.

References GenerateOrderedWithMaxLen().

Referenced by carla::road::Map::GenerateRoadsMultithreaded().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateAllWithMaxLen()

std::vector< std::unique_ptr< Mesh > > carla::geom::MeshFactory::GenerateAllWithMaxLen ( const road::Road road) const

Generates a chunked road with all the features needed for simulation.

Definition at line 675 of file MeshFactory.cpp.

References GenerateWallsWithMaxLen(), GenerateWithMaxLen(), and carla::road::Road::IsJunction().

Referenced by carla::road::Map::GenerateChunkedMesh().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateLaneMarkForRoad()

void carla::geom::MeshFactory::GenerateLaneMarkForRoad ( const road::Road road,
std::vector< std::unique_ptr< Mesh >> &  inout,
std::vector< std::string > &  outinfo 
) const

Definition at line 720 of file MeshFactory.cpp.

References carla::road::Lane::Driving, GenerateLaneMarksForCenterLine(), GenerateLaneMarksForNotCenterLine(), carla::road::Road::GetLaneSections(), and carla::road::Lane::None.

Referenced by carla::road::Map::GenerateLineMarkings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateLaneMarksForCenterLine()

void carla::geom::MeshFactory::GenerateLaneMarksForCenterLine ( const road::Road road,
const road::LaneSection lane_section,
const road::Lane lane,
std::vector< std::unique_ptr< Mesh >> &  inout,
std::vector< std::string > &  outinfo 
) const

Definition at line 879 of file MeshFactory.cpp.

References carla::geom::Mesh::AddIndex(), carla::geom::Mesh::AddVertex(), carla::road::element::DirectedPoint::ApplyLateralOffset(), carla::road::element::LaneMarking::BottsDots, carla::road::element::LaneMarking::Broken, carla::road::element::LaneMarking::BrokenBroken, carla::road::element::LaneMarking::BrokenSolid, carla::road::element::LaneMarking::Curb, carla::geom::MeshFactory::RoadParameters::extra_lane_width, carla::road::Lane::GetCornerPositions(), carla::road::Road::GetDirectedPointIn(), carla::road::LaneSection::GetDistance(), carla::road::Lane::GetInfo(), carla::road::LaneSection::GetLength(), carla::geom::Mesh::GetVertices(), carla::road::element::LaneMarking::Grass, carla::geom::Mesh::IsValid(), carla::geom::Vector3D::Length(), carla::road::element::DirectedPoint::location, carla::road::element::LaneMarking::Other, carla::geom::MeshFactory::RoadParameters::resolution, road_param, carla::road::element::LaneMarking::Solid, carla::road::element::LaneMarking::SolidBroken, carla::road::element::LaneMarking::SolidSolid, carla::road::element::LaneMarking::type, carla::road::element::LaneMarking::width, and carla::geom::Vector3D::y.

Referenced by GenerateLaneMarkForRoad().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateLaneMarksForNotCenterLine()

void carla::geom::MeshFactory::GenerateLaneMarksForNotCenterLine ( const road::LaneSection lane_section,
const road::Lane lane,
std::vector< std::unique_ptr< Mesh >> &  inout,
std::vector< std::string > &  outinfo 
) const

◆ GenerateLaneSectionOrdered()

void carla::geom::MeshFactory::GenerateLaneSectionOrdered ( const road::LaneSection lane_section,
std::map< carla::road::Lane::LaneType, std::vector< std::unique_ptr< Mesh >>> &  result 
) const

Generates a mesh that defines a lane section.

Definition at line 194 of file MeshFactory.cpp.

References carla::road::Lane::Driving, GenerateSidewalk(), GenerateTesselated(), carla::road::LaneSection::GetLanes(), road_param, carla::road::Lane::Sidewalk, and carla::geom::MeshFactory::RoadParameters::vertex_width_resolution.

Referenced by GenerateOrderedWithMaxLen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateLeftWall()

std::unique_ptr< Mesh > carla::geom::MeshFactory::GenerateLeftWall ( const road::Lane lane,
const double  s_start,
const double  s_end 
) const

Generates a wall-like mesh at the left side of the lane.

Definition at line 431 of file MeshFactory.cpp.

References carla::geom::Mesh::AddMaterial(), carla::geom::Mesh::AddTriangleStrip(), DEBUG_ASSERT, carla::geom::Mesh::EndMaterial(), carla::geom::MeshFactory::RoadParameters::extra_lane_width, carla::road::Lane::GetCornerPositions(), carla::road::Lane::GetDistance(), carla::road::Lane::GetId(), carla::road::Lane::GetLength(), carla::road::Lane::GetType(), carla::road::Lane::IsStraight(), RELEASE_ASSERT, carla::geom::MeshFactory::RoadParameters::resolution, road_param, carla::road::Lane::Sidewalk, and carla::geom::MeshFactory::RoadParameters::wall_height.

Referenced by GenerateWalls(), and GenerateWallsWithMaxLen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateOrderedWithMaxLen() [1/2]

std::map< road::Lane::LaneType, std::vector< std::unique_ptr< Mesh > > > carla::geom::MeshFactory::GenerateOrderedWithMaxLen ( const road::Road road) const

Generates a list of meshes that defines a road with a maximum length.

Definition at line 523 of file MeshFactory.cpp.

References carla::road::Road::GetLaneSections().

Referenced by GenerateAllOrderedWithMaxLen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateOrderedWithMaxLen() [2/2]

std::map< road::Lane::LaneType, std::vector< std::unique_ptr< Mesh > > > carla::geom::MeshFactory::GenerateOrderedWithMaxLen ( const road::LaneSection lane_section) const

Generates a list of meshes that defines a lane_section with a maximum length.

Definition at line 535 of file MeshFactory.cpp.

References carla::road::Lane::Driving, carla::geom::EPSILON, GenerateLaneSectionOrdered(), GenerateSidewalk(), GenerateTesselated(), carla::road::LaneSection::GetDistance(), carla::road::LaneSection::GetLanes(), carla::road::LaneSection::GetLength(), carla::geom::MeshFactory::RoadParameters::max_road_len, road_param, carla::road::Lane::Sidewalk, and carla::geom::MeshFactory::RoadParameters::vertex_width_resolution.

+ Here is the call graph for this function:

◆ GenerateRightWall()

std::unique_ptr< Mesh > carla::geom::MeshFactory::GenerateRightWall ( const road::Lane lane,
const double  s_start,
const double  s_end 
) const

Generates a wall-like mesh at the right side of the lane.

Definition at line 380 of file MeshFactory.cpp.

References carla::geom::Mesh::AddMaterial(), carla::geom::Mesh::AddTriangleStrip(), DEBUG_ASSERT, carla::geom::Mesh::EndMaterial(), carla::geom::MeshFactory::RoadParameters::extra_lane_width, carla::road::Lane::GetCornerPositions(), carla::road::Lane::GetDistance(), carla::road::Lane::GetId(), carla::road::Lane::GetLength(), carla::road::Lane::GetType(), carla::road::Lane::IsStraight(), RELEASE_ASSERT, carla::geom::MeshFactory::RoadParameters::resolution, road_param, carla::road::Lane::Sidewalk, and carla::geom::MeshFactory::RoadParameters::wall_height.

Referenced by GenerateWalls(), and GenerateWallsWithMaxLen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateSidewalk() [1/3]

std::unique_ptr< Mesh > carla::geom::MeshFactory::GenerateSidewalk ( const road::LaneSection lane_section) const

Definition at line 232 of file MeshFactory.cpp.

References carla::geom::EPSILON, and carla::road::LaneSection::GetLanes().

Referenced by GenerateLaneSectionOrdered(), GenerateOrderedWithMaxLen(), GenerateSidewalk(), and carla::road::Map::GenerateSingleJunction().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateSidewalk() [2/3]

std::unique_ptr< Mesh > carla::geom::MeshFactory::GenerateSidewalk ( const road::Lane lane) const

Definition at line 241 of file MeshFactory.cpp.

References carla::geom::EPSILON, GenerateSidewalk(), carla::road::Lane::GetDistance(), and carla::road::Lane::GetLength().

+ Here is the call graph for this function:

◆ GenerateSidewalk() [3/3]

std::unique_ptr< Mesh > carla::geom::MeshFactory::GenerateSidewalk ( const road::Lane lane,
const double  s_start,
const double  s_end 
) const

◆ GenerateTesselated() [1/2]

std::unique_ptr< Mesh > carla::geom::MeshFactory::GenerateTesselated ( const road::Lane lane,
const double  s_start,
const double  s_end 
) const

Generates a mesh that defines a lane from a given s start and end with bigger tesselation.

Definition at line 112 of file MeshFactory.cpp.

References carla::geom::Mesh::AddIndex(), carla::geom::Mesh::AddMaterial(), carla::geom::Mesh::AddUVs(), carla::geom::Mesh::AddVertices(), DEBUG_ASSERT, carla::geom::Mesh::EndMaterial(), carla::geom::MeshFactory::RoadParameters::extra_lane_width, carla::road::Lane::GetCornerPositions(), carla::road::Lane::GetDistance(), carla::road::Lane::GetId(), carla::road::Lane::GetLength(), carla::road::Lane::GetType(), RELEASE_ASSERT, carla::geom::MeshFactory::RoadParameters::resolution, road_param, carla::road::Lane::Sidewalk, and carla::geom::MeshFactory::RoadParameters::vertex_width_resolution.

Referenced by GenerateLaneSectionOrdered(), GenerateOrderedWithMaxLen(), carla::road::Map::GenerateSingleJunction(), and GenerateTesselated().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateTesselated() [2/2]

std::unique_ptr< Mesh > carla::geom::MeshFactory::GenerateTesselated ( const road::Lane lane) const

Generates a mesh that defines the whole lane with bigger tesselation.

Definition at line 56 of file MeshFactory.cpp.

References carla::geom::EPSILON, GenerateTesselated(), carla::road::Lane::GetDistance(), and carla::road::Lane::GetLength().

+ Here is the call graph for this function:

◆ GenerateWalls()

std::unique_ptr< Mesh > carla::geom::MeshFactory::GenerateWalls ( const road::LaneSection lane_section) const

Genrates a mesh representing a wall on the road corners to avoid cars falling down.

Definition at line 358 of file MeshFactory.cpp.

References carla::geom::EPSILON, GenerateLeftWall(), GenerateRightWall(), and carla::road::LaneSection::GetLanes().

Referenced by GenerateWallsWithMaxLen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateWallsWithMaxLen() [1/2]

std::vector< std::unique_ptr< Mesh > > carla::geom::MeshFactory::GenerateWallsWithMaxLen ( const road::Road road) const

Generates a list of meshes that defines a road safety wall with a maximum length.

Definition at line 616 of file MeshFactory.cpp.

References carla::road::Road::GetLaneSections().

Referenced by GenerateAllWithMaxLen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateWallsWithMaxLen() [2/2]

std::vector< std::unique_ptr< Mesh > > carla::geom::MeshFactory::GenerateWallsWithMaxLen ( const road::LaneSection lane_section) const

Generates a list of meshes that defines a lane_section safety wall with a maximum length.

Definition at line 629 of file MeshFactory.cpp.

References carla::geom::EPSILON, GenerateLeftWall(), GenerateRightWall(), GenerateWalls(), carla::road::LaneSection::GetDistance(), carla::road::LaneSection::GetLanes(), carla::road::LaneSection::GetLength(), carla::geom::MeshFactory::RoadParameters::max_road_len, and road_param.

+ Here is the call graph for this function:

◆ GenerateWithMaxLen() [1/2]

std::vector< std::unique_ptr< Mesh > > carla::geom::MeshFactory::GenerateWithMaxLen ( const road::Road road) const

Generates a list of meshes that defines a road with a maximum length.

Definition at line 482 of file MeshFactory.cpp.

References carla::road::Road::GetLaneSections().

Referenced by GenerateAllWithMaxLen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateWithMaxLen() [2/2]

std::vector< std::unique_ptr< Mesh > > carla::geom::MeshFactory::GenerateWithMaxLen ( const road::LaneSection lane_section) const

Generates a list of meshes that defines a lane_section with a maximum length.

Definition at line 495 of file MeshFactory.cpp.

References carla::geom::EPSILON, Generate(), carla::road::LaneSection::GetDistance(), carla::road::LaneSection::GetLanes(), carla::road::LaneSection::GetLength(), carla::geom::MeshFactory::RoadParameters::max_road_len, and road_param.

+ Here is the call graph for this function:

◆ MergeAndSmooth()

std::unique_ptr< Mesh > carla::geom::MeshFactory::MergeAndSmooth ( std::vector< std::unique_ptr< Mesh >> &  lane_meshes) const

Definition at line 1118 of file MeshFactory.cpp.

References carla::geom::GetVertexNeighborhoodAndWeights(), road_param, and carla::geom::Vector3D::z.

Referenced by carla::road::Map::GenerateChunkedMesh(), and carla::road::Map::GenerateMesh().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ road_param

RoadParameters carla::geom::MeshFactory::road_param

The documentation for this class was generated from the following files: