CARTA Backend
The backend component of CARTA
Loading...
Searching...
No Matches
carta::CrtfImportExport Class Reference

#include <CrtfImportExport.h>

Inheritance diagram for carta::CrtfImportExport:
[legend]
Collaboration diagram for carta::CrtfImportExport:
[legend]

Public Member Functions

 CrtfImportExport (std::shared_ptr< casacore::CoordinateSystem > image_coord_sys, const casacore::IPosition &image_shape, int stokes_axis, int file_id, const std::string &file, bool file_is_filename)
 
 CrtfImportExport (std::shared_ptr< casacore::CoordinateSystem > image_coord_sys, const casacore::IPosition &image_shape, int stokes_axis)
 
bool AddExportRegion (const RegionState &region_state, const CARTA::RegionStyle &region_style) override
 
bool ExportRegions (std::string &filename, std::string &error) override
 
bool ExportRegions (std::vector< std::string > &contents, std::string &error) override
 
- Public Member Functions inherited from carta::RegionImportExport
 RegionImportExport (std::shared_ptr< casacore::CoordinateSystem > image_coord_sys, const casacore::IPosition &image_shape, int file_id)
 
 RegionImportExport (std::shared_ptr< casacore::CoordinateSystem > image_coord_sys, const casacore::IPosition &image_shape)
 
virtual ~RegionImportExport ()=default
 
std::vector< RegionPropertiesGetImportedRegions (std::string &error)
 
bool AddExportRegion (const RegionState &region_state, const CARTA::RegionStyle &region_style, const casacore::RecordInterface &region_record, bool pixel_coord)
 

Protected Member Functions

void AddRegionNames () override
 
bool AddExportRegion (CARTA::RegionType region_type, const std::vector< casacore::Quantity > &control_points, const casacore::Quantity &rotation, const CARTA::RegionStyle &region_style) override
 
- Protected Member Functions inherited from carta::RegionImportExport
virtual std::vector< std::string > ReadRegionFile (const std::string &file, bool file_is_filename, const char extra_delim='\0')
 
virtual bool IsCommentLine (const std::string &line)
 
virtual void SetParserDelim (const std::string &delim)
 
virtual void ParseRegionParameters (std::string &region_definition, std::vector< std::string > &parameters, std::unordered_map< std::string, std::string > &properties)
 
CARTA::TextAnnotationPosition GetTextPosition (const std::string &position)
 
void AddTextStyleToProperties (const CARTA::RegionStyle &text_style, RegionProperties &textbox_properties)
 
bool ConvertPointToPixels (std::string &region_frame, std::vector< casacore::Quantity > &point, casacore::Vector< casacore::Double > &pixel_coords)
 
double WorldToPixelLength (casacore::Quantity input, unsigned int pixel_axis)
 
std::string FormatColor (const std::string &color)
 
void ExportAnnCompassStyle (const CARTA::RegionStyle &region_style, const std::string &ann_coord_sys, std::string &region_line)
 
void ImportCompassStyle (std::string &compass_properties, std::string &coordinate_system, CARTA::AnnotationStyle *annotation_style)
 
void ImportRulerStyle (std::string &ruler_properties, std::string &coordinate_system)
 

Private Member Functions

std::string GetImageDirectionFrame ()
 
void ProcessFileLines (std::vector< std::string > &lines)
 
std::string GetRegionDirectionFrame (std::unordered_map< std::string, std::string > &properties)
 
RegionState ImportAnnSymbolText (std::vector< std::string > &parameters, std::string &coord_frame)
 
RegionState ImportAnnBox (std::vector< std::string > &parameters, std::string &coord_frame)
 
RegionState ImportAnnEllipse (std::vector< std::string > &parameters, std::string &coord_frame)
 
RegionState ImportAnnPoly (std::vector< std::string > &parameters, std::string &coord_frame)
 
CARTA::RegionStyle ImportStyleParameters (CARTA::RegionType region_type, std::unordered_map< std::string, std::string > &properties)
 
void ImportFontStyleParameters (std::unordered_map< std::string, std::string > &properties, CARTA::AnnotationStyle *annotation_style)
 
void ImportPointStyleParameters (const std::string &symbol_char, std::unordered_map< std::string, std::string > &properties, CARTA::AnnotationStyle *annotation_style)
 
bool GetBoxControlPoints (std::string &box_definition, std::vector< CARTA::Point > &control_points, float &rotation)
 
bool GetBoxControlPoints (std::vector< std::string > &parameters, std::string &region_frame, std::vector< CARTA::Point > &control_points, float &rotation)
 
bool GetCenterBoxPoints (const std::string &region, casacore::Quantity &cx, casacore::Quantity &cy, casacore::Quantity &width, casacore::Quantity &height, std::string &region_frame, std::vector< CARTA::Point > &control_points)
 
bool GetRectBoxPoints (casacore::Quantity &blcx, casacore::Quantity &blcy, casacore::Quantity &trcx, casacore::Quantity &trcy, std::string &region_frame, std::vector< CARTA::Point > &control_points)
 
casa::AnnSymbol::Symbol GetAnnSymbol (CARTA::PointAnnotationShape point_shape)
 
char GetAnnSymbolCharacter (CARTA::PointAnnotationShape point_shape)
 
std::string GetRegionColor (const CARTA::RegionStyle &region_style)
 
casa::AnnotationBase::LineStyle GetRegionLineStyle (const CARTA::RegionStyle &region_style)
 
void GetAnnotationFontParameters (const CARTA::RegionStyle &region_style, std::string &font, unsigned int &font_size, casa::AnnotationBase::FontStyle &font_style)
 
void GetAnnotationSymbolParameters (const CARTA::RegionStyle &region_style, unsigned int &symbol_size, unsigned int &symbol_thickness)
 
std::string GetAnnotationCoordinateSystem ()
 
void ExportStyleParameters (const CARTA::RegionStyle &region_style, std::string &region_line)
 
void ExportStyleParameters (const CARTA::RegionStyle &region_style, casa::AnnotationBase *region)
 
casacore::Vector< casacore::Stokes::StokesTypes > GetStokesTypes ()
 
std::string GetCrtfVersionHeader ()
 

Private Attributes

std::unordered_map< std::string, std::string > _global_properties
 
int _stokes_axis
 

Additional Inherited Members

- Protected Attributes inherited from carta::RegionImportExport
std::shared_ptr< casacore::CoordinateSystem > _coord_sys
 
casacore::IPosition _image_shape
 
int _file_id
 
std::string _parser_delim
 
std::string _import_errors
 
std::vector< RegionProperties_import_regions
 
std::vector< std::string > _export_regions
 
std::unordered_map< CARTA::RegionType, std::string > _region_names
 
std::unordered_map< CARTA::TextAnnotationPosition, std::string > _text_positions
 

Constructor & Destructor Documentation

◆ CrtfImportExport() [1/2]

CrtfImportExport::CrtfImportExport ( std::shared_ptr< casacore::CoordinateSystem >  image_coord_sys,
const casacore::IPosition &  image_shape,
int  stokes_axis,
int  file_id,
const std::string &  file,
bool  file_is_filename 
)
Here is the call graph for this function:

◆ CrtfImportExport() [2/2]

CrtfImportExport::CrtfImportExport ( std::shared_ptr< casacore::CoordinateSystem >  image_coord_sys,
const casacore::IPosition &  image_shape,
int  stokes_axis 
)
Here is the call graph for this function:

Member Function Documentation

◆ AddExportRegion() [1/2]

bool CrtfImportExport::AddExportRegion ( CARTA::RegionType  region_type,
const std::vector< casacore::Quantity > &  control_points,
const casacore::Quantity &  rotation,
const CARTA::RegionStyle &  region_style 
)
overrideprotectedvirtual

Implements carta::RegionImportExport.

Here is the call graph for this function:

◆ AddExportRegion() [2/2]

bool CrtfImportExport::AddExportRegion ( const RegionState region_state,
const CARTA::RegionStyle &  region_style 
)
overridevirtual

Implements carta::RegionImportExport.

Here is the call graph for this function:

◆ AddRegionNames()

void CrtfImportExport::AddRegionNames ( )
overrideprotectedvirtual

Implements carta::RegionImportExport.

Here is the caller graph for this function:

◆ ExportRegions() [1/2]

bool CrtfImportExport::ExportRegions ( std::string &  filename,
std::string &  error 
)
overridevirtual

Implements carta::RegionImportExport.

Here is the call graph for this function:

◆ ExportRegions() [2/2]

bool CrtfImportExport::ExportRegions ( std::vector< std::string > &  contents,
std::string &  error 
)
overridevirtual

Implements carta::RegionImportExport.

Here is the call graph for this function:

◆ ExportStyleParameters() [1/2]

void CrtfImportExport::ExportStyleParameters ( const CARTA::RegionStyle &  region_style,
casa::AnnotationBase *  region 
)
private
Here is the call graph for this function:

◆ ExportStyleParameters() [2/2]

void CrtfImportExport::ExportStyleParameters ( const CARTA::RegionStyle &  region_style,
std::string &  region_line 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAnnotationCoordinateSystem()

std::string CrtfImportExport::GetAnnotationCoordinateSystem ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAnnotationFontParameters()

void CrtfImportExport::GetAnnotationFontParameters ( const CARTA::RegionStyle &  region_style,
std::string &  font,
unsigned int &  font_size,
casa::AnnotationBase::FontStyle &  font_style 
)
private
Here is the caller graph for this function:

◆ GetAnnotationSymbolParameters()

void CrtfImportExport::GetAnnotationSymbolParameters ( const CARTA::RegionStyle &  region_style,
unsigned int &  symbol_size,
unsigned int &  symbol_thickness 
)
private
Here is the caller graph for this function:

◆ GetAnnSymbol()

casa::AnnSymbol::Symbol CrtfImportExport::GetAnnSymbol ( CARTA::PointAnnotationShape  point_shape)
private
Here is the caller graph for this function:

◆ GetAnnSymbolCharacter()

char CrtfImportExport::GetAnnSymbolCharacter ( CARTA::PointAnnotationShape  point_shape)
private
Here is the caller graph for this function:

◆ GetBoxControlPoints() [1/2]

bool CrtfImportExport::GetBoxControlPoints ( std::string &  box_definition,
std::vector< CARTA::Point > &  control_points,
float &  rotation 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBoxControlPoints() [2/2]

bool CrtfImportExport::GetBoxControlPoints ( std::vector< std::string > &  parameters,
std::string &  region_frame,
std::vector< CARTA::Point > &  control_points,
float &  rotation 
)
private
Here is the call graph for this function:

◆ GetCenterBoxPoints()

bool CrtfImportExport::GetCenterBoxPoints ( const std::string &  region,
casacore::Quantity &  cx,
casacore::Quantity &  cy,
casacore::Quantity &  width,
casacore::Quantity &  height,
std::string &  region_frame,
std::vector< CARTA::Point > &  control_points 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCrtfVersionHeader()

std::string CrtfImportExport::GetCrtfVersionHeader ( )
private
Here is the caller graph for this function:

◆ GetImageDirectionFrame()

std::string CrtfImportExport::GetImageDirectionFrame ( )
private
Here is the caller graph for this function:

◆ GetRectBoxPoints()

bool CrtfImportExport::GetRectBoxPoints ( casacore::Quantity &  blcx,
casacore::Quantity &  blcy,
casacore::Quantity &  trcx,
casacore::Quantity &  trcy,
std::string &  region_frame,
std::vector< CARTA::Point > &  control_points 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetRegionColor()

std::string CrtfImportExport::GetRegionColor ( const CARTA::RegionStyle &  region_style)
private
Here is the caller graph for this function:

◆ GetRegionDirectionFrame()

std::string CrtfImportExport::GetRegionDirectionFrame ( std::unordered_map< std::string, std::string > &  properties)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetRegionLineStyle()

casa::AnnotationBase::LineStyle CrtfImportExport::GetRegionLineStyle ( const CARTA::RegionStyle &  region_style)
private
Here is the caller graph for this function:

◆ GetStokesTypes()

casacore::Vector< casacore::Stokes::StokesTypes > CrtfImportExport::GetStokesTypes ( )
private
Here is the caller graph for this function:

◆ ImportAnnBox()

RegionState CrtfImportExport::ImportAnnBox ( std::vector< std::string > &  parameters,
std::string &  coord_frame 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ImportAnnEllipse()

RegionState CrtfImportExport::ImportAnnEllipse ( std::vector< std::string > &  parameters,
std::string &  coord_frame 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ImportAnnPoly()

RegionState CrtfImportExport::ImportAnnPoly ( std::vector< std::string > &  parameters,
std::string &  coord_frame 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ImportAnnSymbolText()

RegionState CrtfImportExport::ImportAnnSymbolText ( std::vector< std::string > &  parameters,
std::string &  coord_frame 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ImportFontStyleParameters()

void CrtfImportExport::ImportFontStyleParameters ( std::unordered_map< std::string, std::string > &  properties,
CARTA::AnnotationStyle *  annotation_style 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ImportPointStyleParameters()

void CrtfImportExport::ImportPointStyleParameters ( const std::string &  symbol_char,
std::unordered_map< std::string, std::string > &  properties,
CARTA::AnnotationStyle *  annotation_style 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ImportStyleParameters()

CARTA::RegionStyle CrtfImportExport::ImportStyleParameters ( CARTA::RegionType  region_type,
std::unordered_map< std::string, std::string > &  properties 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessFileLines()

void CrtfImportExport::ProcessFileLines ( std::vector< std::string > &  lines)
private
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _global_properties

std::unordered_map<std::string, std::string> carta::CrtfImportExport::_global_properties
private

◆ _stokes_axis

int carta::CrtfImportExport::_stokes_axis
private

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