File indexing completed on 2026-04-09 07:49:45
0001 #pragma once
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 #include "sprop.h"
0029
0030 struct sproplist
0031 {
0032 static constexpr const char* MATERIAL = R"(
0033 0 0 RINDEX 1
0034 0 1 ABSLENGTH 1e12
0035 0 2 RAYLEIGH 1e12
0036 0 3 REEMISSIONPROB 0.
0037 1 0 GROUPVEL 299.792458
0038 1 1 SPARE11 0.
0039 1 2 SPARE12 0.
0040 1 3 SPARE13 0.
0041 )" ;
0042
0043
0044 static constexpr const char* SURFACE = R"(
0045 0 0 EFFICIENCY -2
0046 0 1 SPARE01 -2
0047 0 2 REFLECTIVITY -2
0048 0 3 SPARE03 -2
0049 1 0 SPARE10 -2
0050 1 1 SPARE11 -2
0051 1 2 SPARE12 -2
0052 1 3 SPARE13 -2
0053 )" ;
0054
0055 static const sproplist* Material() ;
0056 static const sproplist* Surface() ;
0057
0058 std::vector<sprop> PROP ;
0059 sproplist(const char* spec );
0060
0061 std::string desc() const ;
0062 void getNames(std::vector<std::string>& pnames, const char* skip_prefix="SPARE") const ;
0063 const sprop* findProp(const char* pname) const ;
0064 const sprop* get(int g, int p) const ;
0065 };
0066
0067 inline const sproplist* sproplist::Material()
0068 {
0069 return new sproplist(MATERIAL) ;
0070 }
0071 inline const sproplist* sproplist::Surface()
0072 {
0073 return new sproplist(SURFACE) ;
0074 }
0075
0076 inline sproplist::sproplist(const char* spec)
0077 {
0078 sprop::Parse(PROP, spec);
0079 }
0080 inline std::string sproplist::desc() const
0081 {
0082 return sprop::Desc(PROP);
0083 }
0084 inline void sproplist::getNames(std::vector<std::string>& pnames, const char* skip_prefix ) const
0085 {
0086 sprop::GetNames(pnames, PROP, skip_prefix);
0087 }
0088 inline const sprop* sproplist::findProp(const char* pname) const
0089 {
0090 return sprop::FindProp(PROP, pname);
0091 }
0092 inline const sprop* sproplist::get(int g, int v) const
0093 {
0094 return sprop::Find(PROP, g, v) ;
0095 }
0096
0097